Exemple #1
0
        public ActionResult AddItems(/*string[] productIDs, int currentGroupOffSet, int currentItemOffset*/ SpendRuleModels data)
        {
            SpendRuleModels model = new SpendRuleModels();

            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("_ItemModal", model));
        }
Exemple #2
0
 public ActionResult AddSpending(int currentOffset, string Condition)
 {
     try
     {
         SpendRuleModels group      = new SpendRuleModels();
         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("_TabSpending", group));
     }
     catch (Exception ex)
     {
         NSLog.Logger.Error("AddSpending", ex);
         return(new HttpStatusCodeResult(400, ex.Message));
     }
 }
Exemple #3
0
 public ActionResult LoadItems(int ItemType)
 {
     try
     {
         var             ListProduct = _productFactory.GetListData("", ItemType);
         SpendRuleModels model       = new SpendRuleModels();
         if (ListProduct != null)
         {
             model.ListProduct = ListProduct.Select(x => new ProductModels
             {
                 ID          = x.ID,
                 Name        = x.Name,
                 Code        = x.Code,
                 ProductType = x.ProductType
             }).ToList();
         }
         return(PartialView("_TableChooseItems", model));
     }
     catch (Exception ex)
     {
         NSLog.Logger.Error("LoadItems : ", ex);
         return(new HttpStatusCodeResult(400, ex.Message));
     }
 }