protected void BtnAdd_Click(object sender, EventArgs e) { CheckCreatorKey(); if (Month.Value == null || Year.Value == null) { return; } //ScriptManager.RegisterStartupScript(this.Page, typeof(string), "Resize", "changeWidth.resizeWidth();", true); int CopyMOP = 0, PreMonth = 0, PreYear = 0; if (Checkbox.Checked) { CopyMOP = 1; string[] arr = MonthYearCombo.Text.ToString().Split('-'); string arr_month = arr[0]; //MRPClass.PrintString(MonthYearCombo.Text.ToString()); string arr_year = arr[1]; PreMonth = Convertion.MONTH_TO_INDEX(arr_month); PreYear = Convert.ToInt32(arr_year); } string month = Month.Value.ToString(); string year = Year.Value.ToString(); string sResult = MRPClass.Insert_MRP(month, year, Convert.ToInt32(Session["CreatorKey"].ToString()), Session["EntityCode"].ToString(), Session["BUCode"].ToString(), CopyMOP, PreMonth, PreYear, WarningPopUp, WarningText, PopUpControl); string[] txtSplit = sResult.Split('|'); int iRes = Convert.ToInt32(txtSplit[0]); string docNumber = txtSplit[1].ToString(); int mrpKey = Convert.ToInt32(txtSplit[2]); if (iRes == 1) { Session["mrp_creator"] = Session["CreatorKey"].ToString(); PopUpControl.ShowOnPageLoad = false; Session["mrp_docNum"] = docNumber.ToString(); Session["mrp_wrkLine"] = "0"; Response.Redirect("mrp_addedit.aspx?DocNum=" + docNumber.ToString() + "&WrkFlwLn=0"); } }