protected void btnSubmit_Click(object sender, EventArgs e) { string rem_qty = WebTools.GetExpr("BAL_QTY", "VIEW_TOTAL_PIPE_REM", "REM_ID=" + Request.QueryString["REM_ID"]); PIP_PIPE_REMAIN_USETableAdapter rem_use = new PIP_PIPE_REMAIN_USETableAdapter(); try { if (rem_qty != "" && rem_qty.Length > 0) { if (decimal.Parse(rem_qty) < decimal.Parse(txtQty.Text)) { Master.ShowWarn("Remain Quantity is not enough!"); return; } } rem_use.InsertQuery(decimal.Parse(Request.QueryString["REM_ID"]), decimal.Parse(cboBOM.SelectedValue.ToString()), decimal.Parse(txtQty.Text)); historyGridView.DataBind(); Master.ShowMessage("Insert completed successfully!"); } catch (Exception ex) { Master.ShowWarn(ex.Message); } finally { rem_use.Dispose(); } }
protected void btnYes_Click(object sender, EventArgs e) { try { dsCuttingPlanTableAdapters.PIP_PIPE_REMAIN_USETableAdapter remain = new PIP_PIPE_REMAIN_USETableAdapter(); remain.DeleteQuery(decimal.Parse(historyGridView.SelectedValue.ToString())); historyGridView.Rebind(); Master.ShowMessage("Item Deleted."); } catch (Exception ex) { Master.ShowWarn(ex.Message); } }