Beispiel #1
0
        public ActionResult SetClosureDate(ClosureDate cd)
        {
            if (cd.AcademicYear != null && cd.ClosureDate1 != null && cd.FinalClosureDate != null)
            {
                db.ClosureDates.Add(cd);
                db.SaveChanges();

                ViewBag.Message = "Success!";
            }
            else
            {
                ViewBag.Message = "Fail!";
            }

            return(RedirectToAction("ViewClosureDate", "Admin"));;
        }
Beispiel #2
0
        public void GenerateHeader(bool closed)
        {
            Table HeaderTable = report.AddTable(6, 4); //6 sor, 4 oszlop; fix méret

            HeaderTable.Rows[0].Cells[0].Paragraphs[0].Append("Reactioncode:").Bold().Alignment = Alignment.right;
            HeaderTable.Rows[0].Cells[1].Paragraphs[0].Append(ReactionCode);
            HeaderTable.Rows[0].Cells[2].Paragraphs[0].Append("Laboratory").Bold().Alignment = Alignment.right;
            HeaderTable.Rows[0].Cells[3].Paragraphs[0].Append(Laboratory);

            HeaderTable.Rows[1].Cells[0].Paragraphs[0].Append("Chemist:").Bold().Alignment = Alignment.right;
            HeaderTable.Rows[1].Cells[1].Paragraphs[0].Append(Chemist);
            HeaderTable.Rows[1].Cells[2].Paragraphs[0].Append("Date of start:").Bold().Alignment = Alignment.right;
            HeaderTable.Rows[1].Cells[3].Paragraphs[0].Append(StartDate.ToShortDateString()); //Date->string!!!

            HeaderTable.Rows[2].Cells[0].Paragraphs[0].Append("Chiefchemist:").Bold().Alignment = Alignment.right;
            HeaderTable.Rows[2].Cells[1].Paragraphs[0].Append(Chiefchemist);
            HeaderTable.Rows[2].Cells[2].Paragraphs[0].Append("Date of closure:").Bold().Alignment = Alignment.right;
            if (closed)
            {
                HeaderTable.Rows[2].Cells[3].Paragraphs[0].Append(ClosureDate.ToShortDateString());         //Date->string!!!
            }
            HeaderTable.Rows[3].Cells[0].Paragraphs[0].Append("Project:").Bold().Alignment = Alignment.right;
            HeaderTable.Rows[3].Cells[1].Paragraphs[0].Append(ProjectName);

            HeaderTable.Rows[4].Cells[0].Paragraphs[0].Append("Previous step:").Bold().Alignment = Alignment.right;
            HeaderTable.Rows[4].Cells[1].Paragraphs[0].Append(PreviousStep);

            HeaderTable.Rows[5].Cells[0].Paragraphs[0].Append("Literature:").Bold().Alignment = Alignment.right;
            HeaderTable.Rows[5].Cells[1].Paragraphs[0].Append(Literature);

            Border nullBorder = new Border();

            nullBorder.Tcbs = BorderStyle.Tcbs_none;
            HeaderTable.SetBorder(TableBorderType.InsideH, nullBorder);
            HeaderTable.SetBorder(TableBorderType.InsideV, nullBorder);
            HeaderTable.SetBorder(TableBorderType.Bottom, nullBorder);
            HeaderTable.SetBorder(TableBorderType.Left, nullBorder);
            HeaderTable.SetBorder(TableBorderType.Right, nullBorder);
            HeaderTable.SetBorder(TableBorderType.Top, nullBorder);

            report.InsertTable(HeaderTable);
            Console.WriteLine("Header generated");
        }