public ActionResult Search(TipServiceChargeViewModels model)
 {
     try
     {
         var datas = _factory.GetListTipServiceCharge(model.StoreID);
         model.ListItem = datas;
     }
     catch (Exception ex)
     {
         _logger.Error("TipServiceCharge_Search: " + ex);
         return(new HttpStatusCodeResult(400, ex.Message));
     }
     return(PartialView("_ListData", model));
 }
        public ActionResult LoadServiceCharge(string StoreID)
        {
            TipServiceChargeFactory _factory = new TipServiceChargeFactory();
            var item = _factory.GetListTipServiceCharge(StoreID);

            return(Json(item, JsonRequestBehavior.AllowGet));
        }
Exemple #3
0
        /*POnS*/
        public ActionResult AddMoreProductItemOnStore(int currentOffset, string StoreID, string StoreName)
        {
            InteProductItemOnStore model        = new InteProductItemOnStore();
            InteProductPriceModels PriceOnStore = new InteProductPriceModels();

            model.OffSet         = currentOffset;
            model.StoreName      = StoreName;
            model.StoreID        = StoreID;
            model.CurrencySymbol = CurrentUser.CurrencySymbol;
            //================Price
            SeasonFactory         seasonf          = new SeasonFactory();
            List <SeasonModels>   lstSs            = seasonf.GetListSeason(model.StoreID, null, CurrentUser.ListOrganizationId);
            List <SelectListItem> lstSllItemSeason = new List <SelectListItem>();
            SelectListItem        sslItemSeason;

            foreach (var season in lstSs)
            {
                sslItemSeason          = new SelectListItem();
                sslItemSeason.Value    = season.ID;
                sslItemSeason.Text     = season.Name;
                sslItemSeason.Selected = season.ID.Equals(PriceOnStore.SeasonPriceID);
                lstSllItemSeason.Add(sslItemSeason);
            }
            foreach (PriceItem priceItem in model.ListPrices)
            {
                priceItem.ListSeasons = lstSllItemSeason;
            }
            if (model.ListPrices != null && model.ListPrices.Count > 0)
            {
                model.ListPrices[0].Price    = PriceOnStore.DefaultPrice;
                model.ListPrices[1].Price    = PriceOnStore.SeasonPrice == -1 ? 0 : PriceOnStore.SeasonPrice;
                model.ListPrices[1].SeasonID = null;//PriceOnStore.SeasonPriceID;

                model.ListPrices[0].StoreID = model.StoreID;
                model.ListPrices[1].StoreID = model.StoreID;
            }

            //======Category
            model.ListCategories = this.GetSelectListCategoriesInte(StoreID, Commons.EProductType.Modifier.ToString("d"));

            // Updated 08282017
            model.lstCateGroup = this.GetSelectListCategoriesInteSortParent(StoreID, Commons.EProductType.Modifier.ToString("d"));
            if (!string.IsNullOrEmpty(model.CategoryID))
            {
                var cateChoose = model.lstCateGroup.Where(w => w.Id == model.CategoryID).FirstOrDefault();
                if (cateChoose != null)
                {
                    cateChoose.Selected = true;
                }
            }

            //============ LoadServiceCharge
            var objServiceCharge = _tipServiceChargeFactory.GetListTipServiceCharge(model.StoreID);

            if (objServiceCharge != null && objServiceCharge.Count > 0)
            {
                var value            = objServiceCharge[0].Value;
                var IsCurrency       = objServiceCharge[0].IsCurrency;
                var IsIncludedOnBill = objServiceCharge[0].IsIncludedOnBill;
                model.sServiceCharge = value.ToString();
                if (!IsCurrency)
                {
                    //$('#chbServiceCharge').attr('disabled', false);
                    model.ServiceChargeDisabled = false;
                }
                else if (IsCurrency || IsIncludedOnBill)
                {
                    //$('#chbServiceCharge').attr('disabled', true);
                    model.ServiceChargeDisabled = true;
                }
            }
            //==============
            return(PartialView("_ProductItemOnStore", model));
        }