Example #1
0
 internal void SaveIntoOriginal(LC_Size aLC_Size)
 {
     using (var _Context = new ERPSSL_MerchandisingEntities())
     {
         _Context.LC_Size.AddObject(aLC_Size);
         _Context.SaveChanges();
     }
 }
        //------------------------------------------------------------Save All Data----------------------------------------------------------------------------
        protected void saveButton_Click(object sender, EventArgs e)
        {
            // --------------------------############## ---------------  First Load Data To The List ---------------------------------------------------------
            string ocode       = ((SessionUser)Session["SessionUser"]).OCode;
            Guid   User        = ((SessionUser)Session["SessionUser"]).UserId;
            int    workOrderId = Convert.ToInt32(WorkOrderId.Text);

            List <ItemsRepo> loadData = aOrderItemsBLL.LoadDataForGrid(ocode, User, workOrderId);

            foreach (ItemsRepo aItemsRepo in loadData)
            {
                LC_Size aLC_Size = new LC_Size();

                aLC_Size.OrderNo     = aItemsRepo.OrderNo;
                aLC_Size.StyleNo     = aItemsRepo.StyleNo;
                aLC_Size.GMTItem     = aItemsRepo.GMTId;
                aLC_Size.Articale    = aItemsRepo.ArticleNo;
                aLC_Size.ColorID     = aItemsRepo.ColorID;
                aLC_Size.Size        = aItemsRepo.Size;
                aLC_Size.Qty         = aItemsRepo.Quantity;
                aLC_Size.Price       = aItemsRepo.Rate;
                aLC_Size.TotalAmount = aItemsRepo.TotalAmount;
                aLC_Size.CreateUser  = ((SessionUser)Session["SessionUser"]).UserId;
                aLC_Size.CreateDate  = DateTime.Now;
                aLC_Size.OCode       = ((SessionUser)Session["SessionUser"]).OCode;

                aOrderItemsBLL.SaveIntoOriginal(aLC_Size);
            }

            foreach (ItemsRepo aItemsRepo in loadData)
            {
                aOrderItemsBLL.DeleteItem(aItemsRepo.SizeId);
            }

            ScriptManager.RegisterStartupScript(this, GetType(), "Popup", "SuccessAlert('Item Confirmed!!')", true);

            LoadDataInGridView();
            LoadConfirmDataInGridView();
        }
Example #3
0
        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;
            }
        }
Example #4
0
 internal void SaveIntoOriginal(LC_Size aLC_Size)
 {
     aOrderItemsDAL.SaveIntoOriginal(aLC_Size);
 }
Example #5
0
 internal int InsertSize(LC_Size sLC_Size)
 {
     return(_BuyerDal.InsertSize(sLC_Size));
 }
Example #6
0
 internal int InsertSize(LC_Size sLC_Size)
 {
     _Content.LC_Size.AddObject(sLC_Size);
     _Content.SaveChanges();
     return(1);
 }