protected void btnYes_Click(object sender, EventArgs e) { //itemsGridView.DeleteRow(itemsGridView.SelectedIndex); dsPO_ShipmentATableAdapters.VIEW_ADAPTER_MAT_EXCP_REP_ITEMTableAdapter item = new VIEW_ADAPTER_MAT_EXCP_REP_ITEMTableAdapter(); item.DeleteQuery(decimal.Parse(itemsGridView.SelectedValue.ToString())); itemsGridView.Rebind(); }
protected void btnSubmit_Click(object sender, EventArgs e) { decimal mat_id = db_lookup.MAT_ID(txtMatCode.Text, Decimal.Parse(Session["PROJECT_ID"].ToString())); if (mat_id == -1) { // Master.ShowWarn("There are two materials with the same code! try to use the unique one."); RadWindowManager1.RadAlert("There are two materials with the same code! try to use the unique one.", 400, 150, "Warning", ""); return; } else if (mat_id == 0) { // Master.ShowWarn("Material Code not found!"); RadWindowManager1.RadAlert("Material Code not found!", 400, 150, "Warning", ""); return; } if (WebTools.GetExpr("HEAT_NO", "PRC_MAT_INSP_DETAIL", " WHERE HEAT_NO='" + txtHeatNo.Text + "'") == "") { //Master.ShowWarn("Heat number not found!"); RadWindowManager1.RadAlert("Heat number not found!", 400, 150, "Warning", ""); return; } VIEW_ADAPTER_MAT_EXCP_REP_ITEMTableAdapter excp_items = new VIEW_ADAPTER_MAT_EXCP_REP_ITEMTableAdapter(); try { excp_items.InsertQuery(decimal.Parse(Request.QueryString["EXCP_ID"]), mat_id, cboFalg.SelectedValue.ToString(), decimal.Parse(txtQty.Text), txtRemarks.Text, txtHeatNo.Text, cabledrum.SelectedValue.ToString(), txtPOitem.Text, txtMRItem.Text); Master.ShowMessage("new exception item added."); itemsGridView.DataBind(); } catch (Exception ex) { // Master.ShowWarn(ex.Message); RadWindowManager1.RadAlert("Access denied.", 400, 150, "Warning", ""); } finally { excp_items.Dispose(); } }