protected void btnSave_Click(object sender, EventArgs e) { try { LC_Measurement_Parameter _Magerment_Parameter = new LC_Measurement_Parameter(); _Magerment_Parameter.Measurement_Name = txtMagerment_Parameter.Text; _Magerment_Parameter.FinishGoods_Id = Convert.ToInt32(ddlFinishGoods.SelectedValue); _Magerment_Parameter.CreateDate = DateTime.Today; _Magerment_Parameter.CreateUser = (((SessionUser)Session["SessionUser"]).UserId); _Magerment_Parameter.OCode = Convert.ToString(((SessionUser)Session["SessionUser"]).OCode); if (btnSave.Text != "Update") { int result = _Buyerbll.InsertMagerment_Parameter(_Magerment_Parameter); if (result == 1) { ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Measurement Parameter Saved Successfully')", true); } } else { _Magerment_Parameter.Measurement_Id = Convert.ToInt16(hidMParameter_Id.Value); _Magerment_Parameter.EditUser = (((SessionUser)Session["SessionUser"]).UserId);; int result = _Buyerbll.UpdateMagerment_Parameter(_Magerment_Parameter); if (result == 1) { ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Measurement Parameter Updated Successfully')", true); } } GetMeasurementParameterList(); ClearAllController(); } catch (Exception) { throw; } }