//Add Two More filed from here----------------------------------------------------------------------------------------------------------------------------
        protected void addButton_Click(object sender, EventArgs e)
        {
            LC_OrderEntry aLC_OrderEntry = new LC_OrderEntry();

            if (txtPOrder.Text == "")
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "Popup", "CommonRequiredFiledError('Please Insert Order No')", true);
            }
            else
            {
                aLC_OrderEntry.SMV        = sMVTextBox.Text;
                aLC_OrderEntry.Efficiency = efficiencyTextBox.Text;

                int result = aPreCostingBLL.UpdateTwoInfo(aLC_OrderEntry, txtPOrder.Text);

                if (result == 1)
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), "Popup", "SuccessAlert('Added Successfully!!')", true);
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), "Popup", "CommonRequiredFiledError('Failed To Add. Try Again!!')", true);
                }
            }
        }
        //private void FillSeason()
        //{
        //    try
        //    {
        //        string ocode = ((SessionUser)Session["SessionUser"]).OCode;
        //        List<Rep_MasterLC> row = _orderSheetbll.GetOrderByDistrinct(ocode);

        //        if (row != null)
        //        {
        //            ddlSeason.DataSource = row.ToList();
        //            ddlSeason.DataTextField = "SeasonName";
        //            ddlSeason.DataValueField = "MlcID";
        //            ddlSeason.DataBind();
        //            ddlSeason.AppendDataBoundItems = false;
        //            ddlSeason.Items.Insert(0, new ListItem("--Select Season--", "0"));

        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        throw ex;
        //    }
        //}

        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            try
            {
                LC_OrderEntry orderEntry = new LC_OrderEntry();

                string   seasonname = ddlSeason.SelectedItem.ToString();
                string[] values     = seasonname.Split('-');
                orderEntry.Season = values[0].ToString();
                //orderEntry.Buyer_Department = txtBuyerDepartment.Text;
                orderEntry.OrderNo = txtOrder.Text;

                orderEntry.Create_Date = DateTime.Today;
                orderEntry.Create_User = ((SessionUser)Session["SessionUser"]).UserId;
                orderEntry.OCODE       = ((SessionUser)Session["SessionUser"]).OCode;

                int orderid = Convert.ToInt32(hidorderid.Value);
                var result  = masterBLL.UpdateOrderEntry(orderEntry, orderid);
                if (result == 1)
                {
                    lblMessageUpdate.Text = "Data Update Successfully";
                }
                GridTask.Visible = false;
                Clear();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        internal int UpdateTwoInfo(LC_OrderEntry aLC_OrderEntry, string orderNo)
        {
            try
            {
                LC_OrderEntry LC_OrderEntry = _Context.LC_OrderEntry.First(x => x.OrderNo == orderNo);

                LC_OrderEntry.SMV        = aLC_OrderEntry.SMV;
                LC_OrderEntry.Efficiency = aLC_OrderEntry.Efficiency;
                _Context.SaveChanges();
                return(1);
            }
            catch (Exception)
            {
                throw;
            }
        }
 internal int SaveOrderEntry(LC_OrderEntry aLC_OrderEntry)
 {
     try
     {
         using (var _Context = new ERPSSL_MerchandisingEntities())
         {
             _Context.LC_OrderEntry.AddObject(aLC_OrderEntry);
             _Context.SaveChanges();
             return(1);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 internal int UpdateOrder(String orderEntry, LC_OrderEntry orderObj)
 {
     try
     {
         LC_OrderEntry ObjLOrder = _Content.LC_OrderEntry.First(x => x.OrderNo == orderEntry);
         ObjLOrder.ExtendShipmentDate = orderObj.ExtendShipmentDate;
         ObjLOrder.Shipment_Mode      = orderObj.Shipment_Mode;
         ObjLOrder.ShipmentCompStatus = orderObj.ShipmentCompStatus;
         ObjLOrder.CompShipmentDate   = orderObj.CompShipmentDate;
         _Content.SaveChanges();
         return(1);
     }
     catch (Exception)
     {
         throw;
     }
 }
Beispiel #6
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            LC_OrderEntry orderObj   = new LC_OrderEntry();
            var           orderEntry = txtOrder.Text;

            foreach (GridViewRow grvrow  in grdShipment.Rows)
            {
                CheckBox rowChkBox = ((CheckBox)grvrow.FindControl("rowLevelCheckBox"));
                DateTime?nullDate  = null;
                if (rowChkBox.Checked == true)
                {
                    //DropDownList ddlShipmentMode = ((DropDownList)grvrow.FindControl("ddlShipmentMode"));
                    TextBox txtCompDate = ((TextBox)grvrow.FindControl("txtCompDate"));
                    Label   lblID       = ((Label)grvrow.FindControl("lblOrderNo"));
                    TextBox txtExtDate  = ((TextBox)grvrow.FindControl("txtExtDate"));


                    //orderObj.Shipment_Mode = ddlShipmentMode.SelectedItem.Text;
                    orderObj.ExtendShipmentDate = Convert.ToDateTime(txtExtDate.Text);
                    if (txtCompDate.Text != "")
                    {
                        orderObj.CompShipmentDate   = Convert.ToDateTime(txtCompDate.Text);
                        orderObj.ShipmentCompStatus = "Shipped";
                    }
                    else
                    {
                        orderObj.CompShipmentDate   = nullDate;
                        orderObj.ShipmentCompStatus = "On hand";
                    }

                    orderObj.Edit_User = ((SessionUser)Session["SessionUser"]).UserId;
                    orderObj.Edit_Date = DateTime.Now;
                    int result = shipmentBll.UpdateOrder(orderEntry, orderObj);
                    if (result == 1)
                    {
                        ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Data Added Successfully')", true);
                    }
                    grdShipment.DataSource = null;
                    grdShipment.DataBind();
                    btnSubmit.Visible = false;
                    txtOrder.Text     = "";
                    txtBuyer.Text     = "";
                }
            }
        }
        private LC_OrderEntry ConvertToLC_OrderEntry(LC_OrderEntryTemp _OrderETemps)
        {
            LC_OrderEntry _objoen = new LC_OrderEntry();

            _objoen.LCNo               = _OrderETemps.LCNo;
            _objoen.OrderNo            = _OrderETemps.OrderNo;
            _objoen.OrderQuantity      = _OrderETemps.OrderQuantity;
            _objoen.ShipmentDate       = _OrderETemps.ShipmentDate;
            _objoen.Edit_User          = _OrderETemps.Edit_User;
            _objoen.Edit_Date          = _OrderETemps.Edit_Date;
            _objoen.Create_User        = _OrderETemps.Create_User;
            _objoen.Create_Date        = _OrderETemps.Create_Date;
            _objoen.OCODE              = _OrderETemps.OCODE;
            _objoen.Season             = _OrderETemps.Season;
            _objoen.Article            = _OrderETemps.Article;
            _objoen.ColorSpecification = _OrderETemps.ColorSpecification;
            _objoen.Style              = _OrderETemps.Style;
            _objoen.FobQty             = _OrderETemps.FobQty;
            _objoen.TotalQty           = _OrderETemps.TotalQty;
            return(_objoen);
        }
        //--------------------------------------------------------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();
        }
Beispiel #9
0
 internal int UpdateOrderEntry(LC_OrderEntry orderEntry, int orderid)
 {
     return(_masterlcDAL.UpdateOrderEntry(orderEntry, orderid));
 }
 internal int SaveOrderEntry(LC_OrderEntry aLC_OrderEntry)
 {
     return(aNewOrderEntryDAL.SaveOrderEntry(aLC_OrderEntry));
 }
        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;
            }
        }
Beispiel #12
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            try
            {
                LC_OrderEntry orderEntry = new LC_OrderEntry();

                string   seasonname = ddlSeason.SelectedItem.ToString();
                string[] values     = seasonname.Split('-');
                // orderEntry.OrderReceiveDate = txtStyle.Text;
                orderEntry.Season           = values[0].ToString();
                orderEntry.Buyer_Department = txtBuyerDepartment.Text;
                // orderEntry.Supplier_No = txtSupplierNo.Text;
                orderEntry.OrderNo = txtOrder.Text;
                //orderEntry.LCNo = hidLcNo.Value;
                // orderEntry.Article = txtArticle.Text;
                //orderEntry.ColorSpecification = txtColor.Text;
                // orderEntry.OrderQuantity = txtOrderQty.Text;
                //orderEntry.FobQty = Convert.ToDouble(txtFob.Text);
                //orderEntry.Style = ddlStyle.SelectedItem.Text;


                //if (chkNewstyle.Checked == true)
                //{
                //    orderEntry.Style = txtStyle.Text;
                //}
                //else
                //{
                //  orderEntry.Style = ddlStyle.SelectedItem.Text;
                //}
                // orderEntry.Size = txtsize.Text;
                //orderEntry.Comments = txtComments.Text;
                // orderEntry.ShipmentDate = Convert.ToDateTime(txtDate.Text);
                // orderEntry.Delivery_Date = Convert.ToDateTime(txtDeliveryDate.Text);
                // orderEntry.Yarn_Fabrication = txtYarnFabrication.Text;
                // orderEntry.LC_Reveived_Date = Convert.ToDateTime(txtLCReceivedDate.Text);
                // orderEntry.Schedule_Date = Convert.ToDateTime(txtScheduleDate.Text);
                // orderEntry.ShipmentMode = txtShipmentMode.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)
                //    {
                //        lblMessage.Text = "Data Saved Successfully";
                //        txtBuyerDepartment.Focus();
                //        //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)
                {
                    //foreach (GridViewRow gvRow in GridTask.Rows)
                    //{

                    //    //CheckBox rowChkBox = ((CheckBox)gvRow.FindControl("rowTaskCheckBox"));

                    //    //if (rowChkBox.Checked == true)
                    //    //{
                    //        Label lblInput_Name = ((Label)gvRow.FindControl("lblInput_Name"));
                    //        TextBox ScheduleDate = ((TextBox)gvRow.FindControl("txtScheduleDate"));
                    //        DropDownList ddlStatus = ((DropDownList)gvRow.FindControl("ddlstatus"));
                    //        DropDownList ddlResponsiblePerson = ((DropDownList)gvRow.FindControl("ddlResponsiblePerson"));
                    //        TextBox txtComent = ((TextBox)gvRow.FindControl("txtComments"));

                    //        //Label lblWorkingDay = ((Label)gvRow.FindControl("lblWorkingDay"));

                    //        LC_Task_Details aLC_Task_Details = new LC_Task_Details();



                    //        aLC_Task_Details.Task = lblInput_Name.Text;
                    //        aLC_Task_Details.Order_No = txtOrder.Text;
                    //        aLC_Task_Details.Schedule_Date = Convert.ToDateTime(ScheduleDate.Text);
                    //        aLC_Task_Details.Responsible_Person = ddlResponsiblePerson.Text;
                    //        aLC_Task_Details.Status = ddlStatus.Text;

                    //        aLC_Task_Details.EditDate = DateTime.Today;
                    //        aLC_Task_Details.EditUser = ((SessionUser)Session["SessionUser"]).UserId;
                    //        aLC_Task_Details.Create_Date = DateTime.Today;
                    //        aLC_Task_Details.Create_User = ((SessionUser)Session["SessionUser"]).UserId;
                    //        aLC_Task_Details.OCode = ((SessionUser)Session["SessionUser"]).OCode;

                    //        int result1 = masterBLL.InsertTaskDetails(aLC_Task_Details);

                    //    //}


                    //}


                    lblMessageUpdate.Text = "Data Update Successfully";
                    //ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Data Updated Successfully')", true);
                }
                //}

                // LoadGrid(lblLCNo.Text.ToString());
                GridTask.Visible = false;
                Clear();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #13
0
 internal int UpdateTwoInfo(LC_OrderEntry aLC_OrderEntry, string orderNo)
 {
     return(aPreCostingDAL.UpdateTwoInfo(aLC_OrderEntry, orderNo));
 }
Beispiel #14
0
 internal int InsertAllMlcAndOEntry(LC_OrderEntry lC_OrderEntry)
 {
     return(_masterlcDAL.InsertAllMlcAndOEntry(lC_OrderEntry));
 }
Beispiel #15
0
 internal int UpdateOrderEntry(LC_OrderEntry objOentry, string LCNo, string OrderNo)
 {
     return(_masterlcDAL.UpdateOrderEntry(objOentry, LCNo, OrderNo));
 }
 internal int UpdateOrder(string orderEntry, LC_OrderEntry orderObj)
 {
     return(shipmentBll.UpdateOrder(orderEntry, orderObj));
 }
Beispiel #17
0
 internal int InsertOrderEntry(LC_OrderEntry objneworder)
 {
     return(_masterlcDAL.InsertOrderEntry(objneworder));
 }
        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;
            }
        }