Ejemplo n.º 1
0
        // GET: QuarterItems/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            QuarterItem quarterItem = db.QuarterItems.Find(id);

            if (quarterItem == null)
            {
                return(HttpNotFound());
            }
            return(View(quarterItem));
        }
Ejemplo n.º 2
0
            public void Write(XslFOProfileWriter writer)
            {
                writer.Header("Затраты в разрезе департаментов");
                writer.AddSubHeader(@"<fo:block font-weight=""bold"" text-align=""left"">Параметры отчета:</fo:block>");

                WriteParam(writer, "Период времени", PeriodTypeItem.GetItem(ps.PeriodType).Description);
                if (ps.PeriodType == PeriodType.DateInterval)
                {
                    WriteParam(writer, "С", ps.IntervalBegin.HasValue ? ps.IntervalBegin.Value.ToString("dd.MM.yyyy") : "Не задан");
                    WriteParam(writer, "По", ps.IntervalEnd.HasValue ? ps.IntervalEnd.Value.ToString("dd.MM.yyyy") : "Не задан (используется текущая дата)");
                }
                else if (ps.PeriodType == PeriodType.SelectedQuarter)
                {
                    WriteParam(writer, "Квартал", ps.Quarter.HasValue ? QuarterItem.GetItem(ps.Quarter.Value).Description : "Не задан");
                }

                WriteParam(writer, "Активность", ps.FolderName);
                WriteParam(writer, "Детализация по отделам и группам", ps.ShowDetalization ? "Да" : "Нет");
                WriteParam(writer, "Представление времени", TimeMeasureUnitsItem.GetItem(ps.TimeMeasureUnits).Description);
                WriteParam(writer, "Порядок сортировки", ReportDepartmentCostSortItem.GetItem(ps.SortBy).Description);
            }
Ejemplo n.º 3
0
        public ActionResult ChangeStartDate([Bind(Include = "StartQuarterId,TaskItemId")] QuarterItem quarterItem)
        {
            //server side validation
            var isInvalid = this.quarterItemValidator.TryInvalidate(quarterItem, out string errorMessage);

            if (isInvalid)
            {
                ViewBag.QuarterItems = new SelectList(db.QuarterItems.Include(q => q.Quarter).Include(q => q.Quarter1).Include(q => q.TaskItem).Where(s => s.TaskItemId == quarterItem.TaskItemId).AsEnumerable <QuarterItem>());
                ModelState.AddModelError("StartQuarterId", errorMessage);
                ViewBag.StartQuarterId = new SelectList(db.Quarters, "Id", "Quarter_Desc");
                ViewBag.TaskItemId     = new SelectList(db.TaskItems.Where(a => a.Id == quarterItem.TaskItemId).Select(t => t.Id));

                return(View(quarterItem));
            }

            quarterItem.isOriginal       = false;
            quarterItem.isUpdated        = true;
            quarterItem.LastTimeModified = DateTime.Now;
            quarterItem.CreatedDate      = DateTime.Now;
            db.QuarterItems.Add(quarterItem);
            db.SaveChanges();
            return(RedirectToAction("Details", "ItemDepartments", new { id = quarterItem.TaskItemId }));
        }