Beispiel #1
0
 public ActionResult LoadItemsEarn(int ItemType)
 {
     try
     {
         var            lstDish = _productFactory.GetListData("", ItemType);
         EarnRuleModels model   = new EarnRuleModels();
         if (lstDish != null)
         {
             model.ListProduct = new List <ProductModels>();
             foreach (var item in lstDish)
             {
                 ProductModels product = new ProductModels()
                 {
                     ID          = item.ID,
                     Name        = item.Name,
                     Code        = item.Code,
                     ProductType = item.ProductType
                 };
                 model.ListProduct.Add(product);
             }
         }
         return(PartialView("_TableChooseItemsEarn", model));
     }
     catch (Exception ex)
     {
         NSLog.Logger.Error("LoadItemsEarn : ", ex);
         return(new HttpStatusCodeResult(400, ex.Message));
     }
 }
Beispiel #2
0
        public ActionResult AddItemsEarn(/*string[] productIDs, int currentGroupOffSet, int currentItemOffset*/ EarnRuleModels data)
        {
            try
            {
                EarnRuleModels model = new EarnRuleModels();
                if (data.ListProduct != null && data.ListProduct.Count() > 0)
                {
                    model.ListProduct = new List <ProductModels>();
                }

                for (int i = 0; i < data.ListProduct.Count(); i++)
                {
                    ProductModels item = new ProductModels();

                    item.OffSet = data.currentItemOffset;

                    item.ID          = data.ListProduct[i].ID;
                    item.Code        = data.ListProduct[i].Code;
                    item.Name        = data.ListProduct[i].Name;
                    item.ProductType = data.ListProduct[i].ProductType;
                    model.ListProduct.Add(item);

                    data.currentItemOffset++;
                }
                model.OffSet = data.currentgroupOffSet;
                return(PartialView("_ItemModalEarn", model));
            }
            catch (Exception ex)
            {
                NSLog.Logger.Error("AddItemsEarn : ", ex);
                return(new HttpStatusCodeResult(400, ex.Message));
            }
        }
Beispiel #3
0
 public ActionResult AddEarning(int currentOffset, string Condition)
 {
     try
     {
         EarnRuleModels group      = new EarnRuleModels();
         int            _Condition = Condition.Equals("AND") ?(int)Commons.EOperatorType.And : Condition.Equals("OR") ?(int)Commons.EOperatorType.Or : (int)Commons.EOperatorType.All;
         group.OffSet    = currentOffset;
         group.Condition = _Condition;
         return(PartialView("_TabEarning", group));
     }
     catch (Exception ex)
     {
         NSLog.Logger.Error("AddEarning : ", ex);
         return(new HttpStatusCodeResult(400, ex.Message));
     }
 }