public JsonResult SaveServiceIssuePlan(int serviceIssueId, string periodStr)
        {
            if (serviceIssueId <= 0)
            {
                return(Json(new { error = "Не указана заявка" }));
            }
            var dts = periodStr.Split('|');

            if (!dts.Any())
            {
                return(Json(new { error = "Не указан период" }));
            }

            DateTime         periodStart = DateTime.Parse(dts[0]);
            DateTime         periodEnd   = DateTime.Parse(dts[1]);
            ServiceIssuePlan plan        = new ServiceIssuePlan(serviceIssueId, 1, periodStart, periodEnd);

            try
            {
                ResponseMessage responseMessage;
                bool            result = plan.Save(out responseMessage);
                if (!result)
                {
                    throw new Exception(responseMessage.ErrorMessage);
                }
                plan.Id = responseMessage.Id;
            }
            catch (Exception ex)
            {
                return(Json(new { error = ex.Message }));
            }
            return(Json(plan));
        }
        public ActionResult GetServiceIssuePlanItem(int?id)
        {
            if (!id.HasValue)
            {
                return(HttpNotFound());
            }
            var issue = ServiceIssuePlan.Get(id.Value);

            return(PartialView("ServiceIssuePlanItem", issue));
        }
        public PartialViewResult PeriodWeekView(int?year, int?month)
        {
            var periodList = ServiceIssuePlan.GetPeriodMonthList(year.Value, month.Value);

            return(PeriodWeekView(periodList));
        }