0
 protected void btnSave_Click(object sender, EventArgs e)
 {
    double a, b, c, d;
    a = Convert.ToDouble(lblpurchasequantity.Text.ToString());
    b = Convert.ToDouble(lblreceivedqty.Text.ToString());
    c = Convert.ToDouble(txtreceivedquantity.Text.ToString());
    d = b + c;
    if (a >= d)
    {
        int? insertgrnorecords;
        IFormatProvider provider = new System.Globalization.CultureInfo("en-CA", true);
        String datetime = txtgoodsreceiveddate.Text.ToString();
        DateTime dt = DateTime.Parse(datetime, provider, System.Globalization.DateTimeStyles.NoCurrentDateDefault);
        objsupplyPL.goodsreceiveddate = dt;
        objsupplyPL.productid1 = Hidden1.Value.ToString();
        objsupplyPL.purchaseid = Hid_Sno1.Value.ToString();
        objsupplyPL.vehicleno = (txtvehicleno.Text.Trim().ToString() == "" ? null : txtvehicleno.Text.Trim());
        objsupplyPL.grno = txtgrno.Text.Trim().ToString();
        objsupplyPL.dcno = txtdcno.Text.Trim().ToString();
        objsupplyPL.username = Session["username"].ToString();
        objsupplyPL.quantity = Convert.ToDouble(lblpurchasequantity.Text.ToString());
        objsupplyPL.receivedquantity = Convert.ToDouble(txtreceivedquantity.Text.ToString());
        objsupplyPL.totalreceived = Convert.ToDouble(lblreceivedqty.Text.ToString());
        objsupplyPL.branch = Hid_Sno.Value;
        insertgrnorecords = objsupplyBAL.insertgrnotorecords(objsupplyPL);
        buildBranches();
        clear();

       ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "UpdateDetails", "alert('Save Successful');", true);


    }
 }

实际上,此代码用于弹出窗口字段插入,如果我单击保存按钮,则显示保存成功消息..然后转到一般 aspx 页面..在那个 GRNO 按钮有..然后我单击 GRNO 两次,第一次 GRNO 按钮未触发,第二次将触发

4

0 回答 0