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 })); }
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 })); } }