protected void imgButtonEidt_Click(object sender, EventArgs e) { ImageButton imgbtn = (ImageButton)sender; GridViewRow row = (GridViewRow)imgbtn.NamingContainer; try { Label lblBuyerId = (Label)grdStyle.Rows[row.RowIndex].FindControl("lblByerId"); int ByeryId = Convert.ToInt16(lblBuyerId.Text); LC_Style _buyerSetup = _Buyerbll.GetStyleById(ByeryId); if (_buyerSetup != null) { txtStyle.Text = _buyerSetup.StyleName; txtSpecification.Text = _buyerSetup.Specification; txtHSCode.Text = _buyerSetup.HS_Code; txtCAT.Text = _buyerSetup.CAT; //FileUpload1.FileBytes=_buyerSetup.Style_Photo.; byte[] picUp = SetImage(); picUp = _buyerSetup.Style_Photo; Session["picUp"] = picUp; hidBueyId.Value = _buyerSetup.StyleId.ToString(); } btnSave.Text = "Update"; } catch (Exception ex) { throw ex; } }
protected void imgButtonEidt_Click(object sender, EventArgs e) { ImageButton imgbtn = (ImageButton)sender; GridViewRow row = (GridViewRow)imgbtn.NamingContainer; try { Label lblBuyerId = (Label)grdStyle.Rows[row.RowIndex].FindControl("lblByerId"); int ByeryId = Convert.ToInt16(lblBuyerId.Text); LC_Style _buyerSetup = _Buyerbll.GetStyleById(ByeryId); if (_buyerSetup != null) { hidBueyId.Value = _buyerSetup.StyleId.ToString(); txtStyle.Text = _buyerSetup.StyleName; txtSpecification.Text = _buyerSetup.Specification; txtHSCode.Text = _buyerSetup.HS_Code; txtMenLadies.Text = _buyerSetup.MenLadies; txtTopBottom.Text = _buyerSetup.TopBottom; txtProductDescription.Text = _buyerSetup.ProductDescription; txtFabrics.Text = _buyerSetup.Fabrics; txtAccessories.Text = _buyerSetup.Accessories; ddlCountry.SelectedValue = Convert.ToString(_buyerSetup.CountryOfProduction); txtPrice.Text = Convert.ToString(_buyerSetup.Price); } btnSave.Text = "Update"; } catch (Exception ex) { throw ex; } }
internal int SaveStyle(LC_Style aLC_Style) { using (var _Context = new ERPSSL_MerchandisingEntities()) { _Context.LC_Style.AddObject(aLC_Style); _Context.SaveChanges(); return(aLC_Style.StyleId); } }
protected void btnSave_Click(object sender, EventArgs e) { try { byte[] pic = SetImage(); byte[] res = Session["picUp"] as byte[]; LC_Style _Style = new LC_Style(); _Style.StyleName = txtStyle.Text; _Style.Specification = txtSpecification.Text; _Style.HS_Code = txtHSCode.Text; _Style.CAT = txtCAT.Text; if (FileUpload1.FileName == "") { _Style.Style_Photo = res; } else { _Style.Style_Photo = pic; } //UploadStyleImage(_Style); _Style.CreateDate = DateTime.Today; _Style.CreateUser = (((SessionUser)Session["SessionUser"]).UserId); _Style.CreateDate = DateTime.Today; _Style.OCode = Convert.ToString(((SessionUser)Session["SessionUser"]).OCode); if (btnSave.Text != "Update") { int result = _Buyerbll.InsertStyle(_Style); if (result == 1) { ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Style Saved Successfully')", true); } } else { _Style.StyleId = Convert.ToInt16(hidBueyId.Value); _Style.EditUser = (((SessionUser)Session["SessionUser"]).UserId);; int result = _Buyerbll.UpdateStyle(_Style); if (result == 1) { ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Style Updated Successfully')", true); } } GetStyleList(); ClearAllController(); } catch (Exception ex) { throw ex; } }
internal int AddStyle(LC_Style style) { try { _Content.LC_Style.AddObject(style); _Content.SaveChanges(); return(style.StyleId); } catch (Exception) { throw; } }
internal int UpdateStyle(LC_Style style) { LC_Style _style = _Content.LC_Style.FirstOrDefault(x => x.StyleId == style.StyleId); _style.StyleName = style.StyleName; _style.Specification = style.Specification; _style.HS_Code = style.HS_Code; _style.CAT = style.CAT; _style.Style_Photo = style.Style_Photo; _style.EditDate = DateTime.Today; _style.EditUser = style.EditUser; _Content.SaveChanges(); return(1); }
protected void btnSave_Click(object sender, EventArgs e) { try { LC_Style _Style = new LC_Style(); _Style.StyleName = txtStyle.Text; _Style.Specification = txtSpecification.Text; _Style.HS_Code = txtHSCode.Text; _Style.MenLadies = txtMenLadies.Text; _Style.TopBottom = txtTopBottom.Text; _Style.ProductDescription = txtProductDescription.Text; _Style.Fabrics = txtFabrics.Text; _Style.Accessories = txtAccessories.Text; _Style.CountryOfProduction = ddlCountry.SelectedItem.Text; if (txtPrice.Text == "") { _Style.Price = 0; } else { _Style.Price = Convert.ToDouble(txtPrice.Text); } byte[] pic = SetImage(); _Style.Style_Photo = pic; //UploadStyleImage(_Style); _Style.CreateDate = DateTime.Today; _Style.CreateUser = (((SessionUser)Session["SessionUser"]).UserId); _Style.CreateDate = DateTime.Today; _Style.OCode = Convert.ToString(((SessionUser)Session["SessionUser"]).OCode); if (btnSave.Text != "Update") { int result = _Buyerbll.InsertStyle(_Style); if (result == 1) { //LC_Size sLC_Size = new LC_Size(); var myList = (List <StyleSize>)Session["entries_rv"]; foreach (StyleSize size in myList) { LC_Size sLC_Size = new LC_Size(); sLC_Size.Size_From = size.SizeFrom; sLC_Size.Style_No = txtStyle.Text; sLC_Size.Size_To = size.SizeTo; sLC_Size.Size_Type = size.type; int result1 = _Buyerbll.InsertSize(sLC_Size); } objStyleSize.Clear(); CurrentID = 1; this.BindListData(); Session["entries_rv"] = null; ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Style Saved Successfully')", true); } } else { _Style.StyleId = Convert.ToInt16(hidBueyId.Value); _Style.EditUser = (((SessionUser)Session["SessionUser"]).UserId);; int result = _Buyerbll.UpdateStyle(_Style); if (result == 1) { ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Style Updated Successfully')", true); } } GetStyleList(); ClearAllController(); } catch (Exception ex) { throw ex; } }
protected void btnSubmit_Click(object sender, EventArgs e) { try { DateTime?NullDate = null; int StyleId = 0; int BuyDept = 0; int StyleCatId = 0; if (txtPOrder.Text == "") { ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Enter Order No!')", true); return; } if (ddlStyle.SelectedItem.Text == "--Select Style--" && txtStyle.Text == "") { ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Select Style!')", true); return; } if (ddlSeason.SelectedItem.Text == "--Select Season--" && txtSeason.Text == "") { ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Select Season!')", true); return; } if (ddlBuyer.SelectedItem.Text == "--Select Buyer--") { ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Select Buyer!')", true); return; } LC_Season aLC_Season = new LC_Season(); if (ChkSeason.Checked == true) { aLC_Season.Season_Name = txtSeason.Text; aLC_Season.CreateDate = DateTime.Today; aLC_Season.CreateUser = ((SessionUser)Session["SessionUser"]).UserId; aLC_Season.OCode = ((SessionUser)Session["SessionUser"]).OCode; var result = _orderSheetbll.AddSeason(aLC_Season); } LC_BuyerDepartment _LC_BuyerDepartment = new LC_BuyerDepartment(); if (chkBuyerDepartment.Checked == true) { int count = (from Bd in _Context.LC_BuyerDepartment where Bd.BuyerDepartment_Name == _LC_BuyerDepartment.BuyerDepartment_Name select Bd.BuyerDepartment_Name).Count(); if (count > 0) { ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Buyer Department already Exist')", true); return; } _LC_BuyerDepartment.BuyerDepartment_Name = txtBuyerDepartment.Text; _LC_BuyerDepartment.Create_Date = DateTime.Today; _LC_BuyerDepartment.Create_User = ((SessionUser)Session["SessionUser"]).UserId; _LC_BuyerDepartment.OCode = ((SessionUser)Session["SessionUser"]).OCode; int result = _orderSheetbll.AddBuyerDepartment(_LC_BuyerDepartment); BuyDept = result; } LC_StyleCategor _LC_StyleCategor = new LC_StyleCategor(); if (chkCategory.Checked == true) { int count = (from Bd in _Context.LC_StyleCategor where Bd.Style_Category_Name == _LC_StyleCategor.Style_Category_Name select Bd.Style_Category_Name).Count(); if (count > 0) { ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Style Category already Exist')", true); return; } _LC_StyleCategor.Style_Category_Name = txtCategory.Text; _LC_StyleCategor.CreateDate = DateTime.Today; _LC_StyleCategor.CreateUser = ((SessionUser)Session["SessionUser"]).UserId; _LC_StyleCategor.OCode = ((SessionUser)Session["SessionUser"]).OCode; int result = _orderSheetbll.AddStyleCategor(_LC_StyleCategor); StyleCatId = result; } LC_OrderEntry orderEntry = new LC_OrderEntry(); orderEntry.OrderReceiveDate = Convert.ToDateTime(txtOrderConfirmationDate.Text); if (ChkSeason.Checked == true) { orderEntry.SeasonId = aLC_Season.Season_Id; hidSeasonID.Value = orderEntry.Season; } else { orderEntry.SeasonId = Convert.ToInt32(ddlSeason.SelectedValue); hidSeasonID.Value = orderEntry.Season; } if (chkBuyerDepartment.Checked == true) { orderEntry.Buyer_DepartmentId = BuyDept; } else { orderEntry.Buyer_DepartmentId = Convert.ToInt32(ddlBuyerDepartment.SelectedValue); } orderEntry.OrderQuantity = txtOrderQty.Text; //orderEntry.FobQty = Convert.ToDouble(txtFob.Text); // orderEntry.UnitPrice = Convert.ToDecimal(txtFob.Text); if (chkStleWise.Checked == true) { if (chkNewstyle.Checked == true) { LC_Style aLC_Style = new LC_Style(); aLC_Style.StyleName = txtStyle.Text; aLC_Style.CreateDate = DateTime.Today; aLC_Style.CreateUser = ((SessionUser)Session["SessionUser"]).UserId; aLC_Style.OCode = ((SessionUser)Session["SessionUser"]).OCode; var result = _Buyerbll.AddStyle(aLC_Style); StyleId = result; } if (chkNewstyle.Checked == true) { orderEntry.StyleId = StyleId; } else { orderEntry.StyleId = Convert.ToInt32(ddlStyle.SelectedValue); } orderEntry.OrderNo = txtPOrder.Text; } else { if (chkNewstyle2.Checked == true) { LC_Style aLC_Style = new LC_Style(); aLC_Style.StyleName = txtStyle2.Text; aLC_Style.CreateDate = DateTime.Today; aLC_Style.CreateUser = ((SessionUser)Session["SessionUser"]).UserId; aLC_Style.OCode = ((SessionUser)Session["SessionUser"]).OCode; var result = _Buyerbll.AddStyle(aLC_Style); StyleId = result; } if (chkNewstyle.Checked == true) { orderEntry.StyleId = StyleId; } else { orderEntry.StyleId = Convert.ToInt32(ddlStyle2.SelectedValue); } orderEntry.OrderNo = txtPOrder2.Text; // orderEntry.OrderNo = txtPOrder2.Text; } orderEntry.Style_Description = txtCustomerStyle.Text; orderEntry.EID = ddlMerchandiserName.SelectedValue; if (chkCategory.Checked == true) { orderEntry.Style_Category_Id = StyleCatId; } else { orderEntry.Style_Category_Id = Convert.ToInt32(ddlCategory.SelectedValue); } orderEntry.Currency = ddlCurrency.SelectedItem.Text; orderEntry.Unit_Id = Convert.ToInt32(ddlUnit.SelectedValue); orderEntry.Office_ID = Convert.ToInt32(ddlTTOffice.SelectedValue); orderEntry.Buyer_Name = ddlBuyer.SelectedValue; orderEntry.FOB_Port = txtFOBPort.Text; if (txtShipmentDate.Text == "") { orderEntry.ShipmentDate = NullDate; } else { orderEntry.ShipmentDate = Convert.ToDateTime(txtShipmentDate.Text); } if (txtOrderConfirmationDate.Text == "") { orderEntry.LC_Reveived_Date = NullDate; } else { orderEntry.LC_Reveived_Date = Convert.ToDateTime(txtOrderConfirmationDate.Text); } orderEntry.Shipment_Mode = ddlShipmentMode.SelectedItem.Text; orderEntry.Create_Date = DateTime.Today; orderEntry.Create_User = ((SessionUser)Session["SessionUser"]).UserId; orderEntry.OCODE = ((SessionUser)Session["SessionUser"]).OCode; if (btnSubmit.Text == "Add") { int count = (from orderentry in _Context.LC_OrderEntry where orderentry.OrderNo == orderEntry.OrderNo select orderentry.OrderNo).Count(); if (count > 0) { ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('PO Number already Exist')", true); } else { var result = masterBLL.InsertOrderEntry(orderEntry); if (result == 1) { ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Data Saved Successfully')", true); } } } else { int orderid = Convert.ToInt32(hidorderid.Value); var result = masterBLL.UpdateOrderEntry(orderEntry, orderid); if (result == 1) { ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Data Updated Successfully')", true); } } LoadLCOrderGrid(); Clear(); ShowDiv.Visible = false; ShowGrid.Visible = true; //AddOrder.Visible = true; } catch (Exception ex) { throw ex; } }
internal int UpdateStyle(LC_Style style) { return(_BuyerDal.UpdateStyle(style)); }
internal int AddStyle(LC_Style style) { return(_BuyerDal.AddStyle(style)); }
internal int InsertStyle(LC_Style style) { return(_BuyerDal.InsertStyle(style)); }
protected void btnSubmit_Click(object sender, EventArgs e) { try { int StyleId = 0; if (ddlStyle.SelectedItem.Text == "--Select Style--" && txtStyle.Text == "") { ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Select Style')", true); return; } if (chkNewstyle.Checked == true) { LC_Style aLC_Style = new LC_Style(); aLC_Style.StyleName = txtStyle.Text; aLC_Style.CreateDate = DateTime.Today; aLC_Style.CreateUser = ((SessionUser)Session["SessionUser"]).UserId; aLC_Style.OCode = ((SessionUser)Session["SessionUser"]).OCode; var result = _Buyerbll.AddStyle(aLC_Style); StyleId = result; } int SesonId = 0; if (ddlSeason.SelectedItem.Text == "---Select One---" && txtSeason.Text == "") { ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Select Season')", true); return; } if (chkSeason.Checked == true) { LC_Season _LC_Season = new LC_Season(); _LC_Season.Season_Name = txtSeason.Text; _LC_Season.CreateUser = ((SessionUser)Session["SessionUser"]).UserId; _LC_Season.CreateDate = DateTime.Now; _LC_Season.OCode = ((SessionUser)Session["SessionUser"]).OCode; int result = masterBLL.SaveLC_Season(_LC_Season); SesonId = result; } LC_OrderEntry orderEntry = new LC_OrderEntry(); //string seasonname = ddlSeason.SelectedItem.ToString(); //string[] values = seasonname.Split('-'); orderEntry.OrderReceiveDate = Convert.ToDateTime(txtOrderReceivedDate.Text); //orderEntry.Season = values[0].ToString(); orderEntry.Buyer_Department = txtBuyerDepartment.Text; orderEntry.Supplier_No = txtSupplierNo.Text; orderEntry.OrderNo = txtOrder.Text; orderEntry.LCNo = lblLCNo.Text; orderEntry.Article = txtArticle.Text; orderEntry.ColorSpecification = txtColor.Text; orderEntry.OrderQuantity = txtOrderQty.Text; orderEntry.FobQty = Convert.ToDouble(txtFob.Text); if (chkNewstyle.Checked == true) { orderEntry.StyleId = StyleId; } else { orderEntry.StyleId = Convert.ToInt32(ddlStyle.SelectedValue); } if (chkSeason.Checked == true) { orderEntry.SeasonId = SesonId; } else { orderEntry.SeasonId = Convert.ToInt32(ddlSeason.SelectedValue); } orderEntry.Size = txtsize.Text; orderEntry.Shipment_Mode = ddlShipmentMode.SelectedValue; orderEntry.ShipmentDate = Convert.ToDateTime(txtDate.Text); orderEntry.FiberContent1 = txtFiberContent1.Text; orderEntry.FiberContent2 = txtFiberContent2.Text; orderEntry.Create_Date = DateTime.Today; orderEntry.Create_User = ((SessionUser)Session["SessionUser"]).UserId; orderEntry.OCODE = ((SessionUser)Session["SessionUser"]).OCode; orderEntry.TotalQty = Convert.ToDouble(txtValue.Text); if (btnSubmit.Text == "Add") { var result = masterBLL.InsertOrderEntry(orderEntry); if (result == 1) { ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Data Saved Successfully')", true); } } else { int orderid = Convert.ToInt32(hidorderid.Value); var result = masterBLL.UpdateOrderEntry(orderEntry, orderid); if (result == 1) { ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Data Updated Successfully')", true); } } LoadGrid(lblLCNo.Text.ToString()); Clear(); } catch (Exception ex) { throw ex; } }
internal int SaveStyle(LC_Style aLC_Style) { return(aNewOrderEntryDAL.SaveStyle(aLC_Style)); }
//--------------------------------------------------------Submit Button Work------------------------------------------------------------------------------- protected void btnSubmit_Click(object sender, EventArgs e) { try { //Check stylewise check box is checked or not--------------------------------------###################################---------------------- if (chkStleWise.Checked == false) { // If style wise is not checked-------------------------------------------------------- if (txtOrderReceivedDate.Text == "") { //ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Input Order Received Date!')", true); ScriptManager.RegisterStartupScript(this, GetType(), "Popup", "CommonRequiredFiledError('Please Insert Order Receive Date');", true); return; } else if (txtPOrder.Text == "") { //ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Enter Order No!')", true); ScriptManager.RegisterStartupScript(this, GetType(), "Popup", "CommonRequiredFiledError('Please Insert Order No');", true); return; } if (chkNewstyle.Checked == true || chkNewstyle.Checked == false) { if (chkNewstyle.Checked == false) { if (ddlStyle.SelectedItem.Text == "--Select Style--") { //ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Select Style!')", true); ScriptManager.RegisterStartupScript(this, GetType(), "Popup", "CommonRequiredFiledError('Please Select Style');", true); return; } else { styleId = Convert.ToInt32(ddlStyle.SelectedValue.ToString()); } } else if (chkNewstyle.Checked == true) { if (txtStyle.Text == "") { //ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Select Style!')", true); ScriptManager.RegisterStartupScript(this, GetType(), "Popup", "CommonRequiredFiledError('Please Insert Style');", true); return; } else { LC_Style aLC_Style = new LC_Style(); aLC_Style.StyleName = txtStyle.Text; aLC_Style.CreateUser = ((SessionUser)Session["SessionUser"]).UserId; aLC_Style.CreateDate = DateTime.Now; aLC_Style.OCode = ((SessionUser)Session["SessionUser"]).OCode; styleId = aNewOrderEntryBLL.SaveStyle(aLC_Style); } } } if (ChkSeason.Checked == true || ChkSeason.Checked == false) { //Save Season----------------------------------------------------------------------------------------------------------- if (ChkSeason.Checked == false) { if (ddlSeason.SelectedItem.Text == "--Select Season--") { //ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Select Season!')", true); ScriptManager.RegisterStartupScript(this, GetType(), "Popup", "CommonRequiredFiledError('Please Select Season');", true); return; } else { seasonId = Convert.ToInt32(ddlSeason.SelectedValue.ToString()); } } else if (ChkSeason.Checked == false) { if (txtSeason.Text == "--Select Season--") { //ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Select Season!')", true); ScriptManager.RegisterStartupScript(this, GetType(), "Popup", "CommonRequiredFiledError('Please Insert Season');", true); return; } else { LC_Season aLC_Season = new LC_Season(); aLC_Season.Season_Name = txtSeason.Text; aLC_Season.CreateUser = ((SessionUser)Session["SessionUser"]).UserId; aLC_Season.CreateDate = DateTime.Now; aLC_Season.OCode = ((SessionUser)Session["SessionUser"]).OCode; seasonId = aNewOrderEntryBLL.SaveSeasion(aLC_Season); } } } if (ddlBuyer.SelectedItem.Text == "--Select Buyer--") { //ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Select Buyer!')", true); ScriptManager.RegisterStartupScript(this, GetType(), "Popup", "CommonRequiredFiledError('Please Select Buyer');", true); return; } else if (chkBuyerDepartment.Checked == true || chkBuyerDepartment.Checked == false) { //Save Buyer Department----------------------------------------------------------------------------------------------------------- if (chkBuyerDepartment.Checked == false) { if (ddlBuyerDepartment.SelectedItem.Text == "--Select Buyer Department--") { //ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "CommonRequiredFiledError('Please Select Buyer Department');", true); ScriptManager.RegisterStartupScript(this, GetType(), "Popup", "CommonRequiredFiledError('Please Select Buyer Department');", true); return; } else { buyerDepartmentId = Convert.ToInt32(ddlBuyerDepartment.SelectedValue.ToString()); } } else if (chkBuyerDepartment.Checked == true) { if (txtBuyerDepartment.Text == "") { ScriptManager.RegisterStartupScript(this, GetType(), "Popup", "CommonRequiredFiledError('Please Insert Buyer Department');", true); } else { LC_BuyerDepartment aLC_BuyerDepartment = new LC_BuyerDepartment(); aLC_BuyerDepartment.BuyerDepartment_Name = txtBuyerDepartment.Text; aLC_BuyerDepartment.Create_User = ((SessionUser)Session["SessionUser"]).UserId; aLC_BuyerDepartment.Create_Date = DateTime.Now; aLC_BuyerDepartment.OCode = ((SessionUser)Session["SessionUser"]).OCode; buyerDepartmentId = aNewOrderEntryBLL.SaveBuyerDepartment(aLC_BuyerDepartment); } } } if (chkCategory.Checked == true || chkCategory.Checked == false) { //Save Category----------------------------------------------------------------------------------------------------------- if (chkCategory.Checked == false) { if (ddlCategory.SelectedItem.Text == "--Select Category--") { //ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "CommonRequiredFiledError('Please Select Category');", true); ScriptManager.RegisterStartupScript(this, GetType(), "Popup", "CommonRequiredFiledError('Please Select Category');", true); return; } else { categoryId = Convert.ToInt32(ddlCategory.SelectedValue.ToString()); } } else { if (txtCategory.Text == "") { ScriptManager.RegisterStartupScript(this, GetType(), "Popup", "CommonRequiredFiledError('Please Insert Category');", true); } else { LC_StyleCategor aLC_StyleCategor = new LC_StyleCategor(); aLC_StyleCategor.Style_Category_Name = txtCategory.Text; aLC_StyleCategor.CreateUser = ((SessionUser)Session["SessionUser"]).UserId; aLC_StyleCategor.CreateDate = DateTime.Now; aLC_StyleCategor.OCode = ((SessionUser)Session["SessionUser"]).OCode; categoryId = aNewOrderEntryBLL.SaveCategory(aLC_StyleCategor); } } } orderReceivedDate = Convert.ToDateTime(txtOrderReceivedDate.Text); orderNo = txtPOrder.Text; buyerId = Convert.ToInt32(ddlBuyer.SelectedValue.ToString()); countryOfBuyer = countryTextBox.Text; unitId = Convert.ToInt32(ddlUnit.SelectedValue.ToString()); marchaendicherId = ddlMerchandiserName.SelectedValue.ToString(); officeId = Convert.ToInt32(ddlTTOffice.SelectedValue.ToString()); LC_OrderEntry aLC_OrderEntry = new LC_OrderEntry(); aLC_OrderEntry.OrderReceiveDate = Convert.ToDateTime(txtOrderReceivedDate.Text); aLC_OrderEntry.OrderNo = txtPOrder.Text; aLC_OrderEntry.StyleId = styleId; aLC_OrderEntry.SeasonId = seasonId; aLC_OrderEntry.Buyer_ID = buyerId; aLC_OrderEntry.Countryof_Production = countryTextBox.Text; aLC_OrderEntry.Buyer_DepartmentId = buyerDepartmentId; aLC_OrderEntry.Style_Category_Id = categoryId; aLC_OrderEntry.Style_Description = txtItemDescription.Text; aLC_OrderEntry.OrderQuantity = txtOrderQty.Text; aLC_OrderEntry.Unit_Id = Convert.ToInt32(ddlUnit.SelectedValue.ToString()); aLC_OrderEntry.Currency = ddlCurrency.Text; aLC_OrderEntry.FOB_Port = txtFOBPort.Text; aLC_OrderEntry.Shipment_Mode = ddlShipmentMode.SelectedItem.Text; aLC_OrderEntry.ShipmentDate = Convert.ToDateTime(txtShipmentDate.Text); aLC_OrderEntry.EID = ddlMerchandiserName.SelectedValue.ToString(); aLC_OrderEntry.Office_ID = Convert.ToInt32(ddlTTOffice.SelectedValue.ToString()); aLC_OrderEntry.Create_User = ((SessionUser)Session["SessionUser"]).UserId; aLC_OrderEntry.Create_Date = DateTime.Now; aLC_OrderEntry.OCODE = ((SessionUser)Session["SessionUser"]).OCode; int result = aNewOrderEntryBLL.SaveOrderEntry(aLC_OrderEntry); if (result == 1) { ScriptManager.RegisterStartupScript(this, GetType(), "Popup", "successalert('Data Save Successfully!!');", true); } else { ScriptManager.RegisterStartupScript(this, GetType(), "Popup", "notsuccessalert('Data Not Save!!');", true); } } else if (chkStleWise.Checked == true) { // If style wise is not checked-------------------------------------------------------- if (txtOrderReceivedDate1.Text == "") { //ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Input Order Received Date!')", true); ScriptManager.RegisterStartupScript(this, GetType(), "Popup", "CommonRequiredFiledError('Please Insert Order Receive Date');", true); return; } else if (txtPOrder2.Text == "") { //ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Enter Order No!')", true); ScriptManager.RegisterStartupScript(this, GetType(), "Popup", "CommonRequiredFiledError('Please Insert Order No');", true); return; } else if (chkNewstyle2.Checked == true || chkNewstyle2.Checked == false) { if (chkNewstyle2.Checked == false) { if (ddlStyle2.SelectedItem.Text == "--Select Style--") { //ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Select Style!')", true); ScriptManager.RegisterStartupScript(this, GetType(), "Popup", "CommonRequiredFiledError('Please Select Style');", true); return; } else { styleId = Convert.ToInt32(ddlStyle2.SelectedValue.ToString()); } } else if (chkNewstyle2.Checked == true) { if (txtStyle2.Text == "") { //ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Select Style!')", true); ScriptManager.RegisterStartupScript(this, GetType(), "Popup", "CommonRequiredFiledError('Please Insert Style');", true); return; } else { LC_Style aLC_Style = new LC_Style(); aLC_Style.StyleName = txtStyle2.Text; aLC_Style.CreateUser = ((SessionUser)Session["SessionUser"]).UserId; aLC_Style.CreateDate = DateTime.Now; aLC_Style.OCode = ((SessionUser)Session["SessionUser"]).OCode; styleId = aNewOrderEntryBLL.SaveStyle(aLC_Style); } } } else if (ChkSeason.Checked == true || ChkSeason.Checked == false) { //Save Season----------------------------------------------------------------------------------------------------------- if (ChkSeason.Checked == false) { if (ddlSeason.SelectedItem.Text == "--Select Season--") { //ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Select Season!')", true); ScriptManager.RegisterStartupScript(this, GetType(), "Popup", "CommonRequiredFiledError('Please Select Season');", true); return; } else { seasonId = Convert.ToInt32(ddlSeason.SelectedValue.ToString()); } } else if (ChkSeason.Checked == false) { if (txtSeason.Text == "--Select Season--") { //ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Select Season!')", true); ScriptManager.RegisterStartupScript(this, GetType(), "Popup", "CommonRequiredFiledError('Please Insert Season');", true); return; } else { LC_Season aLC_Season = new LC_Season(); aLC_Season.Season_Name = txtSeason.Text; aLC_Season.CreateUser = ((SessionUser)Session["SessionUser"]).UserId; aLC_Season.CreateDate = DateTime.Now; aLC_Season.OCode = ((SessionUser)Session["SessionUser"]).OCode; seasonId = aNewOrderEntryBLL.SaveSeasion(aLC_Season); } } } else if (ddlBuyer.SelectedItem.Text == "--Select Buyer--") { //ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Select Buyer!')", true); ScriptManager.RegisterStartupScript(this, GetType(), "Popup", "CommonRequiredFiledError('Please Select Buyer');", true); return; } else if (chkBuyerDepartment.Checked == true || chkBuyerDepartment.Checked == false) { //Save Buyer Department----------------------------------------------------------------------------------------------------------- if (chkBuyerDepartment.Checked == false) { if (ddlBuyerDepartment.SelectedItem.Text == "--Select Buyer Department--") { //ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "CommonRequiredFiledError('Please Select Buyer Department');", true); ScriptManager.RegisterStartupScript(this, GetType(), "Popup", "CommonRequiredFiledError('Please Select Buyer Department');", true); return; } else { buyerDepartmentId = Convert.ToInt32(ddlBuyerDepartment.SelectedValue.ToString()); } } else if (chkBuyerDepartment.Checked == true) { if (txtBuyerDepartment.Text == "") { ScriptManager.RegisterStartupScript(this, GetType(), "Popup", "CommonRequiredFiledError('Please Insert Buyer Department');", true); } else { LC_BuyerDepartment aLC_BuyerDepartment = new LC_BuyerDepartment(); aLC_BuyerDepartment.BuyerDepartment_Name = txtBuyerDepartment.Text; aLC_BuyerDepartment.Create_User = ((SessionUser)Session["SessionUser"]).UserId; aLC_BuyerDepartment.Create_Date = DateTime.Now; aLC_BuyerDepartment.OCode = ((SessionUser)Session["SessionUser"]).OCode; buyerDepartmentId = aNewOrderEntryBLL.SaveBuyerDepartment(aLC_BuyerDepartment); } } } else if (chkCategory.Checked == true || chkCategory.Checked == false) { //Save Category----------------------------------------------------------------------------------------------------------- if (chkCategory.Checked == false) { if (ddlCategory.SelectedItem.Text == "--Select Category--") { //ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "CommonRequiredFiledError('Please Select Category');", true); ScriptManager.RegisterStartupScript(this, GetType(), "Popup", "CommonRequiredFiledError('Please Select Category');", true); return; } else { categoryId = Convert.ToInt32(ddlCategory.SelectedValue.ToString()); } } else { if (txtCategory.Text == "") { ScriptManager.RegisterStartupScript(this, GetType(), "Popup", "CommonRequiredFiledError('Please Insert Category');", true); } else { LC_StyleCategor aLC_StyleCategor = new LC_StyleCategor(); aLC_StyleCategor.Style_Category_Name = txtCategory.Text; aLC_StyleCategor.CreateUser = ((SessionUser)Session["SessionUser"]).UserId; aLC_StyleCategor.CreateDate = DateTime.Now; aLC_StyleCategor.OCode = ((SessionUser)Session["SessionUser"]).OCode; categoryId = aNewOrderEntryBLL.SaveCategory(aLC_StyleCategor); } } } orderReceivedDate = Convert.ToDateTime(txtOrderReceivedDate1.Text); orderNo = txtPOrder2.Text; buyerId = Convert.ToInt32(ddlBuyer.SelectedValue.ToString()); countryOfBuyer = countryTextBox.Text; unitId = Convert.ToInt32(ddlUnit.SelectedValue.ToString()); marchaendicherId = ddlMerchandiserName.SelectedValue.ToString(); officeId = Convert.ToInt32(ddlTTOffice.SelectedValue.ToString()); LC_OrderEntry aLC_OrderEntry = new LC_OrderEntry(); aLC_OrderEntry.OrderReceiveDate = Convert.ToDateTime(txtOrderReceivedDate.Text); aLC_OrderEntry.OrderNo = txtPOrder.Text; aLC_OrderEntry.StyleId = styleId; aLC_OrderEntry.SeasonId = seasonId; aLC_OrderEntry.Buyer_ID = buyerId; aLC_OrderEntry.Countryof_Production = countryTextBox.Text; aLC_OrderEntry.Buyer_DepartmentId = buyerDepartmentId; aLC_OrderEntry.Style_Category_Id = categoryId; aLC_OrderEntry.Style_Description = txtItemDescription.Text; aLC_OrderEntry.OrderQuantity = txtOrderQty.Text; aLC_OrderEntry.Unit_Id = Convert.ToInt32(ddlUnit.SelectedValue.ToString()); aLC_OrderEntry.Currency = ddlCurrency.Text; aLC_OrderEntry.FOB_Port = txtFOBPort.Text; aLC_OrderEntry.Shipment_Mode = ddlShipmentMode.SelectedItem.Text; aLC_OrderEntry.ShipmentDate = Convert.ToDateTime(txtShipmentDate.Text); aLC_OrderEntry.EID = ddlMerchandiserName.SelectedValue.ToString(); aLC_OrderEntry.Office_ID = Convert.ToInt32(ddlTTOffice.SelectedValue.ToString()); aLC_OrderEntry.Create_User = ((SessionUser)Session["SessionUser"]).UserId; aLC_OrderEntry.Create_Date = DateTime.Now; aLC_OrderEntry.OCODE = ((SessionUser)Session["SessionUser"]).OCode; int result = aNewOrderEntryBLL.SaveOrderEntry(aLC_OrderEntry); if (result == 1) { ScriptManager.RegisterStartupScript(this, GetType(), "Popup", "successalert('Data Save Successfully!!');", true); } else { ScriptManager.RegisterStartupScript(this, GetType(), "Popup", "notsuccessalert('Data Not Save!!');", true); } } } catch (Exception ex) { throw ex; } LoadLCOrderGrid(); }