public JsonResult AddTierData(ProductCustomrTierRateUI Model)
        {
            var ProdData = objData.SaveTierData(Model);

            return(new JsonResult {
                Data = ProdData, JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
Exemplo n.º 2
0
        //here now Tier
        public List <dynamic> SaveTierData(ProductCustomrTierRateUI ProductCustomrTierRateI)
        {
            List <dynamic> objDynamic = new List <dynamic>();

            ProductCustomrTierRate productCustomrTierRate = new ProductCustomrTierRate();

            ProductCustomrTierRateUI productCustomrTierI = new ProductCustomrTierRateUI();

            //int orddetid = 0;

            string strOrderID = securityHelper.Decrypt(ProductCustomrTierRateI.StrProductId, false);

            if (!string.IsNullOrEmpty(ProductCustomrTierRateI.TierDetails))
            {
                var Data = JsonConvert.DeserializeObject <List <ProductCustomrTierRateUI> >(ProductCustomrTierRateI.TierDetails);
                for (int i = 0; i < Data.Count; i++)
                {
                    productCustomrTierI = Data[i];

                    if (productCustomrTierI.PCTRId != 0)
                    {
                        productCustomrTierRate.PCTRId = productCustomrTierI.PCTRId;
                    }
                    if (productCustomrTierI.Qty != 0)
                    {
                        productCustomrTierRate.Qty = productCustomrTierI.Qty;
                    }
                    if (productCustomrTierI.Price != 0)
                    {
                        productCustomrTierRate.Price = productCustomrTierI.Price;
                    }
                    if (productCustomrTierI.IsActive)
                    {
                        productCustomrTierRate.IsActive = productCustomrTierI.IsActive;
                    }
                    if (productCustomrTierI.EffectiveFrom != null)
                    {
                        productCustomrTierRate.EffectiveFrom = DateTime.Parse(productCustomrTierI.EffectiveFrom);
                    }

                    productCustomrTierRate.CustId    = ProductCustomrTierRateI.CustId;
                    productCustomrTierRate.ProductId = Convert.ToInt64(strOrderID);
                    productCustomrTierRate.Type      = ProductCustomrTierRateI.Type;



                    AddUpdateProductCustomerTierRate(productCustomrTierRate);
                }
                objDynamic.Add(productCustomrTierRate);
            }
            return(objDynamic);
        }