Beispiel #1
0
 internal int SaveToDeterminationCost(LC_DeterminationCost aLC_DeterminationCost)
 {
     try
     {
         _Context.LC_DeterminationCost.AddObject(aLC_DeterminationCost);
         _Context.SaveChanges();
         return(1);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #2
0
 internal int SaveToDeterminationCost(LC_DeterminationCost aLC_DeterminationCost)
 {
     return(aYarnCountDeterminationDAL.SaveToDeterminationCost(aLC_DeterminationCost));
 }
        protected void confirmButton_Click(object sender, EventArgs e)
        {
            int uniqueId = GenerateUniqueId();



            string ocode = ((SessionUser)Session["SessionUser"]).OCode;


            Guid userIdEccess = ((SessionUser)Session["SessionUser"]).UserId;


            List <YarnDeterminationRepo> dataList = aYarnCountDeterminationBLL.LoadDataForGrid(ocode, userIdEccess);

            try
            {
                foreach (YarnDeterminationRepo aYarnDeterminationRepo in dataList)
                {
                    LC_YarnDetermination aLC_YarnDetermination = new LC_YarnDetermination();

                    aLC_YarnDetermination.FebricNatureId = aYarnDeterminationRepo.FebricNatureId;
                    aLC_YarnDetermination.ColorRangeId   = aYarnDeterminationRepo.ColorRangeId;
                    aLC_YarnDetermination.ConstructionId = aYarnDeterminationRepo.ConstructionId;
                    aLC_YarnDetermination.ProductId      = aYarnDeterminationRepo.ProductId;
                    aLC_YarnDetermination.GSM            = aYarnDeterminationRepo.GSM;
                    aLC_YarnDetermination.CompositionId  = aYarnDeterminationRepo.CompositionId;
                    aLC_YarnDetermination.Percentage     = aYarnDeterminationRepo.Percentage;
                    aLC_YarnDetermination.Price          = aYarnDeterminationRepo.Price;
                    aLC_YarnDetermination.StichLength    = aYarnDeterminationRepo.StichLength;
                    aLC_YarnDetermination.ProcessLoss    = aYarnDeterminationRepo.ProcessLoss;
                    aLC_YarnDetermination.UniqueId       = uniqueId;
                    aLC_YarnDetermination.CreateUser     = ((SessionUser)Session["SessionUser"]).UserId;
                    aLC_YarnDetermination.CreateDate     = DateTime.Now;
                    aLC_YarnDetermination.OCode          = ((SessionUser)Session["SessionUser"]).OCode;

                    aYarnCountDeterminationBLL.SaveDataOriginal(aLC_YarnDetermination);
                }

                foreach (YarnDeterminationRepo aYarnDeterminationRepo in dataList)
                {
                    int tempEntryId = aYarnDeterminationRepo.YarnDeterminationId;

                    aYarnCountDeterminationBLL.DeleteDataFromTemp(tempEntryId);
                }



                LC_DeterminationCost aLC_DeterminationCost = new LC_DeterminationCost();

                aLC_DeterminationCost.ConstructionFinishFebric = Convert.ToDecimal(constructionFinishFebricTextBox.Text);
                aLC_DeterminationCost.KnitingCost      = Convert.ToInt32(kinitingCostTextBox.Text);
                aLC_DeterminationCost.DryingCostOption = dryingCostDropDownList.Text;
                aLC_DeterminationCost.DryingCost       = Convert.ToInt32(dryingCostTextBox.Text);
                aLC_DeterminationCost.TotalCost        = Convert.ToDecimal(totalTextBox.Text);
                aLC_DeterminationCost.UniqueId         = uniqueId;
                aLC_DeterminationCost.CreateUser       = ((SessionUser)Session["SessionUser"]).UserId;
                aLC_DeterminationCost.CreateDate       = DateTime.Now;
                aLC_DeterminationCost.OCode            = ((SessionUser)Session["SessionUser"]).OCode;

                int result = aYarnCountDeterminationBLL.SaveToDeterminationCost(aLC_DeterminationCost);

                if (result == 1)
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), "Popup", "SuccessAlert('Save Successfully!!')", true);
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), "Popup", "notsuccessalert('Not Save!!')", true); return;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            fabNatureDropDownList.Enabled    = true;
            constructionDropDownList.Enabled = true;
            colorRangeDropDownList.Enabled   = true;
            gSMTextBox.Enabled = true;

            //countDropDownList.Text = "";
            //typeDropDownList.Text = "";
            //UMDropDownList.Text = "";

            FillFabricNature();
            FillConstruction();
            FillComposition();
            //FillYarnCount();
            //FillYarnCountType();
            FillColor();
            gSMTextBox.Text        = "";
            percentageTextBox.Text = "";
            priceTextBox.Text      = "";
            txtStichLength.Text    = "";
            txtProcessLoss.Text    = "";

            kinitingCostTextBox.Text    = "";
            dryingCostDropDownList.Text = "";
            dryingCostTextBox.Text      = "";
            totalTextBox.Text           = "";

            LoadDataInGrid();
            LoadDeterminationDataForLastGrid();
        }