protected void SaveBunkerData() { ltmessage.Text = ""; int res = -1; if (ViewState["Bunker_Id"] != null) { res = oCP.UPD_BunkerDetail(UDFLib.ConvertIntegerToNull(ViewState["Bunker_Id"]), UDFLib.ConvertIntegerToNull(Session["CPID"]), UDFLib.ConvertIntegerToNull(ddlFuelType.SelectedValue), ddlFuelType.SelectedItem.Text, ViewState["OType"].ToString(), UDFLib.ConvertToDouble(txtUnit.Text), UDFLib.ConvertToDouble(txtPricePerUnit.Text), GetSessionUserID()); } else { res = oCP.INS_BunkerDetail(UDFLib.ConvertIntegerToNull(Session["CPID"]), UDFLib.ConvertIntegerToNull(ddlFuelType.SelectedValue), ddlFuelType.SelectedItem.Text, ViewState["OType"].ToString(), UDFLib.ConvertToDouble(txtUnit.Text), UDFLib.ConvertToDouble(txtPricePerUnit.Text), GetSessionUserID()); } ViewState["Bunker_Id"] = null; if (res == 0) { ltmessage.Text = "Record already exist for same type ! Please check."; string show = String.Format("showDivAddBunker('dvAddBunker')"); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "showmodal", show, true); } else { ClearBunker(); BindBunkerDetail(); ReBindBunkerDetail(); string hidemodal = String.Format("hideModal('dvAddBunker')"); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "hidemodal", hidemodal, true); } }
protected void SaveData() { ltmessage.Text = ""; int res = -1; if (ViewState["Bunker_Id"] != null) { res = objCP.UPD_BunkerDetail(UDFLib.ConvertIntegerToNull(ViewState["Bunker_Id"]), UDFLib.ConvertIntegerToNull(Session["CPID"]), UDFLib.ConvertIntegerToNull(ddlFuelType.SelectedValue), ddlFuelType.SelectedItem.Text, ViewState["OType"].ToString(), UDFLib.ConvertToDouble(txtUnit.Text), UDFLib.ConvertToDouble(txtPricePerUnit.Text), GetSessionUserID()); } else { res = objCP.INS_BunkerDetail(UDFLib.ConvertIntegerToNull(Session["CPID"]), UDFLib.ConvertIntegerToNull(ddlFuelType.SelectedValue), ddlFuelType.SelectedItem.Text, ViewState["OType"].ToString(), UDFLib.ConvertToDouble(txtUnit.Text), UDFLib.ConvertToDouble(txtPricePerUnit.Text), GetSessionUserID()); } if (res == 0) { ltmessage.Text = "Record already exist for same type ! Please check."; } else { ClearData(); } }