1
protected void GVTraderdueReport_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
{
    GVTraderdueReport.EditIndex = -1;
    GettraderwiseLiftingRecords();
}
protected void GVTraderdueReport_RowEditing(object sender, GridViewEditEventArgs e)
{

    GVTraderdueReport.EditIndex = e.NewEditIndex;
    GettraderwiseLiftingRecords();
}

protected void GVTraderdueReport_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
    TextBox txtrecamount = (TextBox)GVTraderdueReport.Rows[e.RowIndex].Cells[3].Controls[1];
    TextBox txtrecdate = (TextBox)GVTraderdueReport.Rows[e.RowIndex].Cells[4].Controls[1];
    TextBox txtchknumber = (TextBox)GVTraderdueReport.Rows[e.RowIndex].Cells[5].Controls[1];
    TextBox txtremark = (TextBox)GVTraderdueReport.Rows[e.RowIndex].Cells[6].Controls[1];


    string tradername = Convert.ToString(GVTraderdueReport.DataKeys[e.RowIndex].Values[0].ToString());

    IFormatProvider provider = new System.Globalization.CultureInfo("en-CA", true);
    String recdate1 = txtrecdate.Text.Trim().ToString();
    DateTime recdate2 = DateTime.Parse(recdate1, provider, System.Globalization.DateTimeStyles.NoCurrentDateDefault);


    objhatcheryPL.name = tradername;
    objhatcheryPL.cashrec = Convert.ToInt32(txtrecamount.Text.ToString());
    objhatcheryPL.recdate = recdate2;
    objhatcheryPL.chequeno = txtchknumber.Text.ToString();
    objhatcheryPL.remark = txtremark.Text.ToString();
    objhatcheryPL.username = Session["username"].ToString();

    int? chkduetatus;
    chkduetatus = objhatcheryBAL.updateChicksalesDueReport(objhatcheryPL);

    if (chkduetatus.Equals(1))
    {
        ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "SelectDetails", "alert('Updated Successful');", true);
    }
    GVTraderdueReport.EditIndex = -1;
    GettraderwiseLiftingRecords();

}

protected void GVTraderdueReport_RowCommand(object sender, GridViewCommandEventArgs e)
{
    if (e.CommandName.ToUpper() == "VIEWHISTORY")
    {
        GridViewRow row = (GridViewRow)((ImageButton)e.CommandSource).NamingContainer;
        int index = row.RowIndex;
        string farmername = Convert.ToString(GVTraderdueReport.DataKeys[index].Value);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Open", "window.open('../Reports/viewHatcherysalesdueentry.aspx?name=" + farmername + "', '_blank', 'dependent,resizable=yes,scrollbars=yes,top=0,height=600');", true);
    }
}

它在互联网探索中工作,但在谷歌 crome 中它不起作用。我没有得到什么问题。我在母版页中编写了代码。如果我单击编辑按钮,更新和取消按钮正在释放,但是当我单击该按钮时它们没有响应,类似于 GO 按钮。请任何人都可以帮助我。

4

0 回答 0