示例#1
0
        public JsonResult HandlePlanTableByMonth(string prod, int year, int month, int value)
        {
            var handle = new ReqRpt001PlanSetHandler();

            handle.SetValueByMonth(prod, year, month, value);
            return(Json(new { success = true }));
        }
示例#2
0
        public JsonResult HandlePlanTableByList(List <string> prods, List <string> dates, List <int> values)
        {
            var handle = new ReqRpt001PlanSetHandler();
            var res    = handle.SetProdsValueByArray(prods, dates, values);

            return(Json(new { success = true, msg = res }));
        }
示例#3
0
 public JsonResult HandlePlanTableByCmd(string prod, string month, int fromDate, int toDate, int value)
 {
     try
     {
         var arry   = month.Split('-');
         int y      = Convert.ToInt16(arry[0]);
         int m      = Convert.ToInt16(arry[1]);
         int maxDay = DateTime.DaysInMonth(y, m);
         int toDay  = toDate > maxDay ? maxDay : toDate;
         var handle = new ReqRpt001PlanSetHandler();
         if (fromDate == 1 && toDay == maxDay)
         {
             handle.SetValueByMonth(prod, y, m, value);
         }
         else
         {
             string from = month + "-" + (fromDate >= 10 ? fromDate.ToString() : "0" + fromDate);
             string to   = month + "-" + (toDay >= 10 ? toDay.ToString() : "0" + toDay);
             handle.SetValueByDateRange(prod, from, to, value);
         }
         return(Json(new { success = true }));
     }
     catch (Exception ex)
     {
         return(Json(new { success = false, msg = ex.Message }));
     }
 }