Exemplo n.º 1
0
        public static ViewClassReport ToViewModel(ClassReport model)
        {
            if (model == null)
            {
                return(null);
            }

            ViewClassReport item = new ViewClassReport();

            item.Id         = model.Id;
            item.Title      = model.Title;
            item.Content    = model.Content;
            item.UserId     = model.UserId;
            item.ClassId    = model.ClassId;
            item.IsDeleted  = model.IsDeleted;
            item.CreateTime = model.CreateTime;
            List <ViewClassFile> files = (from f in model.ClassFile select ViewClassFile.ToViewModel(f)).ToList();

            item.Images = new List <ViewClassFile>();
            item.Videos = new List <ViewClassFile>();
            foreach (var file in files)
            {
                if (file.Type == 11)
                {
                    item.Images.Add(file);
                }
                else if (file.Type == 12)
                {
                    item.Videos.Add(file);
                }
            }
            return(item);
        }
Exemplo n.º 2
0
        public ActionResult Report(ClassReport classReport)
        {
            DateTime dFrom;
            DateTime dTo;
            DateTime dNow = DateTime.Now;

            bool dateFromOk = DateTime.TryParseExact(classReport.ClassDateFrom, "dd/MM/yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None, out dFrom);
            bool dateToOk   = DateTime.TryParseExact(classReport.ClassDateTo, "dd/MM/yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None, out dTo);

            if (dateFromOk && dateToOk)
            {
                classReport.TotalAttended    = db.MemberClassBookings.Where(bk => bk.Attended && bk.GymClass.ClassDateTime >= dFrom && bk.GymClass.ClassDateTime <= dTo).Count();
                classReport.TotalBookings    = db.MemberClassBookings.Where(bk => !bk.Waiting && bk.GymClass.ClassDateTime >= dFrom && bk.GymClass.ClassDateTime <= dTo).Count();
                classReport.TotalWaitingList = db.MemberClassBookings.Where(bk => bk.Waiting && bk.GymClass.ClassDateTime >= dFrom && bk.GymClass.ClassDateTime <= dTo).Count();
                if (dFrom < dNow && dNow < dTo)
                {
                    dTo = dNow;
                }
                if (dFrom < dNow && dTo <= dNow)
                {
                    classReport.NoShowMembers = NoShowList(dFrom, dTo);
                }
            }
            return(View(classReport));
        }
Exemplo n.º 3
0
        private ClassReport ValidateParameterTypes(ClassReport report)
        {
            foreach (var method in methodPairs.Keys)
            {
                var methodModel = methodPairs[method];
                if (methodModel.ExpectedParameters != null)
                {
                    var parameters         = method.ParameterList.Parameters;
                    var expectedParameters = methodPairs[method].ExpectedParameters;

                    var areMatching = parameters
                                      .SelectMany(x => new ParamList {
                        { x.Type.ToString(), x.Identifier.ToString() }
                    })
                                      .Intersect(expectedParameters)
                                      .Count() == parameters.Count;

                    if (areMatching)
                    {
                        report.ValidMethodsByParameters.Add(method);
                    }
                    else
                    {
                        report.MismatchingParametersMethods.Add(method);
                    }
                }
            }
            return(report);
        }
Exemplo n.º 4
0
        public ClassReport GetClassReportForActualClass(ActualClassDto actualClass)
        {
            ClassReport         cr           = new ClassReport();
            IList <FeedbackDto> feedbackDtos = _feedbackRepository.GetAllFeedbacksForActualClass(actualClass.Id);

            foreach (FeedbackDto dto in feedbackDtos)
            {
                cr.AttractivenessRating          += dto.Attractiveness;
                cr.ClearnessRating               += dto.Clearness;
                cr.ComprehensionRating           += dto.Comprehension;
                cr.CorrectnessRating             += dto.Correctness;
                cr.HighScientificLevelRating     += dto.HighScientificLevel;
                cr.RigorousScientificLevelRating += dto.RigorousScientificLevel;
                cr.UsefulnessRating              += dto.Usefulness;
                cr.NoveltyRating       += dto.Novelty;
                cr.InteractivityRating += dto.Interactivity;
            }

            cr.InteractivityRating           /= feedbackDtos.Count;
            cr.AttractivenessRating          /= feedbackDtos.Count;
            cr.ClearnessRating               /= feedbackDtos.Count;
            cr.ComprehensionRating           /= feedbackDtos.Count;
            cr.CorrectnessRating             /= feedbackDtos.Count;
            cr.HighScientificLevelRating     /= feedbackDtos.Count;
            cr.NoveltyRating                 /= feedbackDtos.Count;
            cr.RigorousScientificLevelRating /= feedbackDtos.Count;
            cr.UsefulnessRating              /= feedbackDtos.Count;

            cr.GeneralRating = (cr.InteractivityRating + cr.ClearnessRating + cr.CorrectnessRating +
                                cr.HighScientificLevelRating + cr.NoveltyRating + cr.RigorousScientificLevelRating +
                                cr.UsefulnessRating + cr.AttractivenessRating) / 8;
            return(cr);
        }
 private void Report_Load(object sender, EventArgs e)
 {
     if (str == "Student")
     {
         StudentReport sr = new StudentReport();
         sr.SetDataSource(dss);
         crystalReportViewer1.ReportSource = sr;
     }
     else if (str == "Staff")
     {
         StaffReport sr2 = new StaffReport();
         sr2.SetDataSource(dss);
         crystalReportViewer1.ReportSource = sr2;
     }
     else if (str == "User")
     {
         UserReport sr2 = new UserReport();
         sr2.SetDataSource(dss);
         crystalReportViewer1.ReportSource = sr2;
     }
     else if (str == "Class")
     {
         ClassReport cr = new ClassReport();
         cr.SetDataSource(dss);
         crystalReportViewer1.ReportSource = cr;
     }
 }
Exemplo n.º 6
0
        private void dgvDetaila_DoubleClick(object sender, EventArgs e)
        {
            GalDetID        = int.Parse(dgvDetaila.CurrentRow.Cells[0].Value.ToString());
            txtProduct.Text = dgvDetaila.CurrentRow.Cells[6].Value.ToString();
            txtCompany.Text = dgvDetaila.CurrentRow.Cells[7].Value.ToString();

            DataTable dt = ClassReport.selectIMGDet(GalDetID);

            Gal_id     = int.Parse(dt.Rows[0][0].ToString());
            Product_ID = int.Parse(dt.Rows[0][1].ToString());
            company_id = int.Parse(dt.Rows[0][2].ToString());

            proImg  = ClassReport.selectProIMG(Product_ID);
            comIMG  = ClassReport.selectComIMG(company_id);
            comBC   = ClassReport.selectBCIMG(company_id);
            catalog = ClassReport.selectCatalogIMG(Gal_id);

            billIMG = ClassReport.selectBillIMG(Gal_id);
            QuotIMG = ClassReport.selectQuotIMG(Gal_id);

            picN1     = picN2 = 1;
            picP1     = picP2 = 0;
            pic1State = pic2State = "";

            txtDate.Text = "";
            // picBox2.Visible = false;
            // picBox1.Visible = false;
            picBox1.Image = picBox2.Image = null;
        }
    // Methods
    public SchoolYearScoreReportNew()
    {
        string reportName = "學年成績單(新制)";
        string reportPath = "成績相關報表";

        this.buttonStudent          = new ButtonAdapter();
        this.buttonStudent.Text     = reportName;
        this.buttonStudent.Path     = reportPath;
        this.buttonStudent.OnClick += new EventHandler(this.buttonStudent_OnClick);
        this.buttonClass            = new ButtonAdapter();
        this.buttonClass.Text       = reportName;
        this.buttonClass.Path       = reportPath;
        this.buttonClass.OnClick   += new EventHandler(this.buttonClass_OnClick);
        StudentReport.AddReport(this.buttonStudent);
        ClassReport.AddReport(this.buttonClass);

        string        Student = "SHEvaluation.SchoolYearScoreReportNew.Student";
        string        Class   = "SHEvaluation.SchoolYearScoreReportNew.Class";
        RibbonBarItem item1   = FISCA.Presentation.MotherForm.RibbonBarItems["學生", "資料統計"];

        item1["報表"][reportPath][reportName].Enable = FISCA.Permission.UserAcl.Current[Student].Executable;
        RibbonBarItem item2 = FISCA.Presentation.MotherForm.RibbonBarItems["班級", "資料統計"];

        item2["報表"][reportPath][reportName].Enable = FISCA.Permission.UserAcl.Current[Class].Executable;

        //權限設定
        Catalog permission1 = RoleAclSource.Instance["學生"]["報表"];

        permission1.Add(new RibbonFeature(Student, reportName));
        Catalog permission2 = RoleAclSource.Instance["班級"]["報表"];

        permission2.Add(new RibbonFeature(Class, reportName));
    }
Exemplo n.º 8
0
        public ViewModel.ViewClassReport Add(ViewModel.ViewClassReport report)
        {
            ClassReport cr = _repository.Add(ViewClassReport.ToEntity(report));

            report.Id = cr.Id;
            return(report);
        }
Exemplo n.º 9
0
 public ClassSemesterScore()
 {
     classButton          = new SecureButtonAdapter("Report0160");
     classButton.Text     = "班級學生學期成績一覽表";
     classButton.Path     = "成績相關報表";
     classButton.OnClick += new EventHandler(classButton_OnClick);
     ClassReport.AddReport(classButton);
 }
 public SemesterMoralScoreCalc()
 {
     button          = new SecureButtonAdapter("Report0270");
     button.Text     = "德行成績試算表(舊制)";
     button.Path     = "學務相關報表";
     button.OnClick += new EventHandler(button_OnClick);
     ClassReport.AddReport(button);
 }
Exemplo n.º 11
0
 public FRM_Report()
 {
     InitializeComponent();
     cmbStatus.Items.Add(FRM_Main.notEXE);
     cmbStatus.Items.Add(FRM_Main.ToDoEXE);
     cmbStatus.Items.Add(FRM_Main.DoneEXE);
     cmbStatus.Text = FRM_Main.ToDoEXE;
     fillEmp();
     dgvTasks.DataSource = ClassReport.selectAllTask();
 }
Exemplo n.º 12
0
        public CreditStatistic()
        {
            ButtonAdapter button = new SecureButtonAdapter("Report0180");

            button.Text     = "學分統計表";
            button.Path     = "成績相關報表";
            button.OnClick += new EventHandler(button_OnClick);

            ClassReport.AddReport(button);
        }
Exemplo n.º 13
0
    public static async Task GenerateAsync(ClassReport classReport, Class selectedClass, int session, string[] classSubjects)
    {
        try
        {
            //Renderer.RenderHtmlAsPdf("<h1>Hello World<h1>").SaveAs("test.pdf");

            //var renderer = new HtmlToPdf();
            //var pdf = renderer.RenderHtmlAsPdf("<h1>Hello IronPdf</h1>");
            //pdf.SaveAs("test.pdf");

            Console.WriteLine("Inside Generator");
            //Console.WriteLine(System.Text.Json.JsonSerializer.Serialize(classSubjects, new System.Text.Json.JsonSerializerOptions { PropertyNamingPolicy = System.Text.Json.JsonNamingPolicy.CamelCase }));


            // downloads chromium to a temp folder, you can also specify a specific version, or a location where it should look for chromium.
            await new BrowserFetcher().DownloadAsync(BrowserFetcher.DefaultRevision);
            Console.WriteLine("Downloaded Browser");

            using var browser = await Puppeteer.LaunchAsync(new LaunchOptions
            {
                Headless = false
            });

            Console.WriteLine("Set headless = false");

            using var page = await browser.NewPageAsync();

            Console.WriteLine("Executed: using var page = await browser.NewPageAsync();");
            var reportCardString = PdfReportCardHtmlTemplate.GetHTMLString(classReport, selectedClass, session, classSubjects);
            Console.WriteLine("Executed: reportCardString as follows:");
            Console.WriteLine(System.Text.Json.JsonSerializer.Serialize(reportCardString, new System.Text.Json.JsonSerializerOptions {
                PropertyNamingPolicy = System.Text.Json.JsonNamingPolicy.CamelCase
            }));
            await page.SetContentAsync(reportCardString);

            Console.WriteLine("Executed: await page.SetContentAsync(reportCardString);");
            await page.GetContentAsync();

            Console.WriteLine("Executed: await page.GetContentAsync();");
            await page.PdfAsync("ReportCard.pdf", new PdfOptions
            {
                DisplayHeaderFooter = false,
                Format    = PaperFormat.A4,
                Landscape = true,
            });

            Console.WriteLine("End of Generator");
        }
        catch (Exception e)
        {
            Console.WriteLine(e.ToString());
        }
    }
Exemplo n.º 14
0
        public static ClassReport ToEntity(ViewClassReport model)
        {
            ClassReport item = new ClassReport();

            item.Id         = model.Id;
            item.Title      = model.Title;
            item.Content    = model.Content;
            item.UserId     = model.UserId;
            item.ClassId    = model.ClassId;
            item.IsDeleted  = model.IsDeleted;
            item.CreateTime = model.CreateTime;



            return(item);
        }
        public ClassReport Build()
        {
            var classReport = new ClassReport();

            ValidateReturnTypes(classReport);
            ValidateParameterTypes(classReport);
            ValidateMethodsExisting(classReport);

            var methodsToCompile = from m in methodPairs
                                   where m.Value.ToBeCompiled
                                   select m.Key;

            if (Directory.Exists(compilationPath))
            {
                HelperMethods.DeleteDirectory(compilationPath);
            }
            else
            {
                Directory.CreateDirectory(compilationPath);
            }

            Parallel.ForEach(methodsToCompile, (method) =>
            {
                var methodModel       = methodPairs[method];
                var compilationResult = CompileMethod(method, methodModel.CompilationParameters);
                compilationResults.Add(compilationResult);

                if (compilationResult.ToString().Contains("Error"))
                {
                    classReport.HadCompilationError = true;
                }

                if (
                    compilationResult.ToString() == methodModel.ExpectedOutput?.ToString() ||
                    compilationResult.ToString() == methodModel.ExpectedStringOutput?.ToString())
                {
                    classReport.ValidMethodsByOutput.Add(method.Identifier.ValueText);
                }
                else
                {
                    classReport.MismatchingOutputMethods.Add(method.Identifier.ValueText);
                }
            });

            HelperMethods.DeleteDirectory(compilationPath);
            return(classReport);
        }
Exemplo n.º 16
0
        private void OnButtonCreateClick(object sender, EventArgs e)
        {
            int index = this.cbSubjects.SelectedIndex;

            if (index < 0 || index >= avaialableClasses.Count)
            {
                return;
            }
            var cls = avaialableClasses[index];

            var report = new ClassReport();

            SQLConnections.FillResultReportsByClass(this.teacherID, cls.ID, this.start, this.end, report);

            this.Close();
            new ClassReportForm(report).ShowDialog();
        }
Exemplo n.º 17
0
 private ClassReport ValidateReturnTypes(ClassReport report)
 {
     foreach (var method in methodPairs.Keys)
     {
         var methodModel = methodPairs[method];
         if (methodModel.ExpectedReturnType != null)
         {
             if (method.ReturnType.ToString().ToLower() == methodModel.ExpectedReturnType?.Name.ToLower())
             {
                 report.ValidMethodsByReturnType.Add(method);
             }
             else
             {
                 report.MismatchingReturnTypeMethods.Add(method);
             }
         }
     }
     return(report);
 }
Exemplo n.º 18
0
        public static void RegistryFeature()
        {
            SemesterScoreReportNew semsScoreReport = new SemesterScoreReportNew();

            string reportName = "學期成績單(新制)";
            string path       = "成績相關報表";

            semsScoreReport.button          = new SecureButtonAdapter("Report0055");
            semsScoreReport.button.Text     = reportName;
            semsScoreReport.button.Path     = path;
            semsScoreReport.button.OnClick += new EventHandler(semsScoreReport.button_OnClick);
            StudentReport.AddReport(semsScoreReport.button);

            semsScoreReport.button2          = new SecureButtonAdapter("Report0155");
            semsScoreReport.button2.Text     = reportName;
            semsScoreReport.button2.Path     = path;
            semsScoreReport.button2.OnClick += new EventHandler(semsScoreReport.button2_OnClick);
            ClassReport.AddReport(semsScoreReport.button2);
        }
Exemplo n.º 19
0
        public SemesterScoreReport()
        {
            string reportName = "學期成績單";
            string path       = "成績相關報表";

            _ErrorMessage = new StringBuilder();

            button          = new SecureButtonAdapter("Report0050");
            button.Text     = reportName;
            button.Path     = path;
            button.OnClick += new EventHandler(button_OnClick);
            StudentReport.AddReport(button);

            button2          = new SecureButtonAdapter("Report0150");
            button2.Text     = reportName;
            button2.Path     = path;
            button2.OnClick += new EventHandler(button2_OnClick);
            ClassReport.AddReport(button2);
        }
Exemplo n.º 20
0
        public ClassReport Build()
        {
            var classReport = new ClassReport();

            ValidateReturnTypes(classReport);
            ValidateParameterTypes(classReport);
            ValidateMethodsExisting(classReport);

            var methodsToCompile = from m in methodPairs
                                   where m.Value.ToBeCompiled
                                   select m.Key;

            Parallel.ForEach(methodsToCompile, (method) =>
            {
                compilationResults.Add(CompileMethod(method, methodPairs[method].CompilationParameters));
            });

            ;

            return(classReport);
        }
Exemplo n.º 21
0
        public ActionResult DeleteRange(string classDateFrom, string classDateTo)
        {
            DateTime    dFrom;
            DateTime    dTo;
            ClassReport classReport = new ClassReport();

            classReport.ClassDateFrom = classDateFrom;
            classReport.ClassDateTo   = classDateTo;
            bool dateFromOk = DateTime.TryParseExact(classDateFrom, "dd/MM/yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None, out dFrom);
            bool dateToOk   = DateTime.TryParseExact(classDateTo, "dd/MM/yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None, out dTo);

            if (dateFromOk && dateToOk)
            {
                var bookings = db.MemberClassBookings.Where(bk => bk.GymClass.ClassDateTime >= dFrom && bk.GymClass.ClassDateTime <= dTo).ToList();
                db.MemberClassBookings.RemoveRange(bookings);
                var classes = db.GymClass.Where(bk => bk.ClassDateTime >= dFrom && bk.ClassDateTime <= dTo).ToList();
                db.GymClass.RemoveRange(classes);
                db.SaveChanges();
            }
            return(RedirectToAction("Report", classReport));
        }
Exemplo n.º 22
0
 private void btnSearch_Click(object sender, EventArgs e)
 {
     if (dtpDate.Enabled == false && cmbStatus.Enabled == false && cmbEmp.Enabled == false)
     {
         MessageBox.Show("لم تحدد اي خيار للبحث");
     }
     else
     {
         if (cmbEmp.Enabled == true && cmbStatus.Enabled == false && dtpDate.Enabled == false)
         {
             dgvTasks.DataSource = ClassReport.selectAllTaskEmp(cmbEmp.Text);
         }
         if (dtpDate.Enabled == true && cmbEmp.Enabled == true && cmbStatus.Enabled == true)
         {
             dgvTasks.DataSource = ClassReport.selectAllTaskDateNmaeState(dtpDate.Value, cmbEmp.Text, cmbStatus.Text);
         }
         if (cmbStatus.Enabled == true && cmbEmp.Enabled == false && dtpDate.Enabled == false)
         {
             dgvTasks.DataSource = ClassReport.selectAllTaskStatus(cmbStatus.Text);
         }
         if (cmbEmp.Enabled == true && cmbStatus.Enabled == true && dtpDate.Enabled == false)
         {
             dgvTasks.DataSource = ClassReport.selectAllTaskNmaeState(cmbEmp.Text, cmbStatus.Text);
         }
         if (dtpDate.Enabled == true && cmbEmp.Enabled == true && cmbStatus.Enabled == false)
         {
             dgvTasks.DataSource = ClassReport.selectAllTaskDateNmae(dtpDate.Value, cmbEmp.Text);
         }
         if (dtpDate.Enabled == true && cmbStatus.Enabled == true && cmbEmp.Enabled == false)
         {
             dgvTasks.DataSource = ClassReport.selectAllTaskDateState(dtpDate.Value, cmbStatus.Text);
         }
         if (dtpDate.Enabled == true && cmbStatus.Enabled == false && cmbEmp.Enabled == false)
         {
             dgvTasks.DataSource = ClassReport.selectAllTaskDate(dtpDate.Value);
         }
     }
 }
Exemplo n.º 23
0
        public MultiSemesterScore()
        {
            string report_name = "多學期成績單";
            string report_path = "成績相關報表";

            //_student_button = new ButtonAdapter();
            //_student_button.Text = report_name;
            //_student_button.Path = report_path;
            //_student_button.OnClick += new EventHandler(studentButton_OnClick);
            //StudentReport.AddReport(_student_button);

            _class_button          = new SecureButtonAdapter("Report0170");
            _class_button.Text     = report_name;
            _class_button.Path     = report_path;
            _class_button.OnClick += new EventHandler(classButton_OnClick);
            ClassReport.AddReport(_class_button);

            ButtonAdapter _student_button = new SecureButtonAdapter("Report0060");

            _student_button.Text     = report_name;
            _student_button.Path     = report_path;
            _student_button.OnClick += new EventHandler(_student_button_OnClick);
            StudentReport.AddReport(_student_button);
        }
Exemplo n.º 24
0
 public override void DecrementCounterFor(ClassReport classReport)
 {
     classReport.FailedTests--;
 }
Exemplo n.º 25
0
        //************************
        //************************

        private void txtSearch_TextChanged(object sender, EventArgs e)
        {
            dgvDetaila.DataSource = ClassReport.SearchInAllDetails(txtSearch.Text);
        }
Exemplo n.º 26
0
        void displayData()
        {
            DataTable dt = ClassReport.SelectAllDetails();

            dgvDetaila.DataSource = dt;
        }
 private void ValidateMethodsExisting(ClassReport report)
 {
     report.MissingMethods          = methodsNotFound;
     report.ValidMethodsByExistence = methodPairs.Keys.ToList().Select(x => x.Identifier.ValueText).ToList();
 }
    private DataSet GetGridData()
    {
        DataSet oDs;

        try
        {
            ClassReport oRep = new ClassReport();

            oDs = oRep.GetBudgetReport(Int32.Parse(this.ddlProjects.SelectedValue.ToString()));
        }

        catch (Exception ex)
        {
            Log.LogMsg(ex.Message);
            oDs = null;
        }

        return oDs;
    }
Exemplo n.º 29
0
    private void OnRenderGraph(ZedGraph.Web.ZedGraphWeb z, System.Drawing.Graphics g, ZedGraph.MasterPane masterPane)
    {
        // Get the GraphPane so we can work with it

        GraphPane myPane = masterPane[0];

        // Set the title and axis labels

        myPane.Title.Text = "";
        myPane.YAxis.Title.Text = "User";
        myPane.XAxis.Title.Text = "Productivity %";

        //	Get productivity for team users.

        DateTime DateStart = this.cc2DateSelector.StartDate();
        DateTime DateEnd = this.cc2DateSelector.EndDate();

        myPane.Title.Text = string.Format("{0} - {1}", ClassTimeAndDate.DateToString(DateStart), ClassTimeAndDate.DateToString(DateEnd));

        ClassReport oRep = new ClassReport();
        DataSet oDs = oRep.GetTeamProductivity(Convert.ToInt32(this.DdlTeams.SelectedValue), Convert.ToInt32(this.DdlUsers.SelectedValue), DateStart, DateEnd);
        Int32 RowNo = 0;

        string[] labels = new string[oDs.Tables[0].Rows.Count];
        double[] values = new double[oDs.Tables[0].Rows.Count];

        for (RowNo = 0; RowNo < oDs.Tables[0].Rows.Count; RowNo++)
        {
            labels[RowNo] = oDs.Tables[0].Rows[RowNo]["UserName"].ToString();
            values[RowNo] = Convert.ToDouble(oDs.Tables[0].Rows[RowNo]["Productivity"].ToString());
        }

        myPane.YAxis.Scale.TextLabels = labels;
        myPane.YAxis.Type = AxisType.Text;

        myPane.XAxis.Scale.Min = 0;
        myPane.XAxis.Scale.Max = 120.0;
        myPane.XAxis.MajorTic.Size = 10.0F;
        myPane.XAxis.MajorTic.IsInside = false;
        myPane.XAxis.MajorGrid.IsVisible = true;
        myPane.XAxis.MinorTic.Size = 5.0F;
        myPane.XAxis.MinorTic.IsInside = false;

        //	Legend.

        BarItem myCurve = myPane.AddBar("Productivity", values, null, Color.Red);

        //	Chart background.

        myPane.Chart.Fill = new Fill(Color.White, Color.FromArgb(255, 255, 166), 45.0F);

        myPane.BarSettings.Base = BarBase.Y;

        masterPane.AxisChange(g);
        BarItem.CreateBarLabels(myPane, false, "f0");

        Page.Title = TXT_PAGETITLE;
        this.LblPageTitle.Text = TXT_PAGETITLE;
    }
Exemplo n.º 30
0
 public abstract void IncrementCounterFor(ClassReport classReport);
Exemplo n.º 31
0
    private DataSet GetGridData()
    {
        DataSet oDs;
        DateTime DateStart = this.cc2DateSelector.StartDate();
        DateTime DateEnd = this.cc2DateSelector.EndDate();

        try
        {
            ClassReport oRep = new ClassReport();

            oDs = oRep.GetTimeSheet(Int32.Parse(this.DdlUsers.SelectedValue.ToString()), DateStart, DateEnd);
        }

        catch (Exception ex)
        {
            Log.LogMsg(ex.Message);
            oDs = null;
        }

        return oDs;
    }
Exemplo n.º 32
0
 private void btnDisplayAll_Click(object sender, EventArgs e)
 {
     dgvTasks.DataSource = ClassReport.selectAllTask();
     cmbEmp.Enabled      = cmbStatus.Enabled = dtpDate.Enabled = false;
     chkEmp.Checked      = chkStatus.Checked = chkDate1.Checked = false;
 }
    private void ShowGrid()
    {
        this.LblFrom.Text = this.cc2DateSelector.StartDate().ToLongDateString();
        this.LblTo.Text = this.cc2DateSelector.EndDate().ToLongDateString();
        this.LblProductive.Text = "";
        this.LblUnproductive.Text = "";
        this.LblProductivePercent.Text = "";

        ClassReport oRep = new ClassReport();
        DataSet oDs = oRep.GetCostCentre(this.cc2DateSelector.StartDate(), this.cc2DateSelector.EndDate());
        double TotalHours = 0.0;
        Boolean bOkay = false;
        double Productive = 0.0;
        double Unproductive = 0.0;

        if (oDs != null)
        {
            if (oDs.Tables.Count > 0)
            {
                if (oDs.Tables[0].Rows.Count > 0)
                {
                    bOkay = true;

                    foreach (DataRow oDr in oDs.Tables[0].Rows)
                    {
                        TotalHours += Convert.ToDouble(oDr["Hours"].ToString());

                        if (oDr["IsProductive"].ToString() == "Yes")
                            Productive += Convert.ToDouble(oDr["Hours"].ToString());
                        else
                            Unproductive += Convert.ToDouble(oDr["Hours"].ToString());
                    }
                }
            }
        }

        ViewState["TotalHours"] = TotalHours.ToString();

        if (bOkay == true)
        {
            this.GridTime.DataSource = oDs;
            this.GridTime.DataBind();
        }
        else
        {
            this.GridTime.DataSource = null;
            this.GridTime.DataBind();
        }

        this.LblProductive.Text = Productive.ToString("N2");
        this.LblUnproductive.Text = Unproductive.ToString("N2");

        if ((Productive + Unproductive) != 0)
        {
            this.LblProductivePercent.Text = string.Format("{0:N2}%", (100 * Productive / (Productive + Unproductive)));
        }
    }
Exemplo n.º 34
0
 private void txtSearch_TextChanged(object sender, EventArgs e)
 {
     dgvTasks.DataSource = ClassReport.SearchPublicAllTask(txtSearch.Text);
     chkDate1.Checked    = chkEmp.Checked = chkStatus.Checked = false;
 }
Exemplo n.º 35
0
 public void AddReport(ClassReport report)
 {
     Reports.Add(report);
 }
    private DataSet GetGridData()
    {
        DataSet oDs;
        DateTime DateStart = this.cc2DateSelector.StartDate();
        DateTime DateEnd = this.cc2DateSelector.EndDate();

        try
        {
            ClassReport oRep = new ClassReport();

            oDs = oRep.GetReportByReference(Convert.ToInt32(this.DdlTeams.SelectedValue.ToString()),
                Convert.ToInt32(this.DdlUsers.SelectedValue), DateStart, DateEnd);
        }

        catch (Exception ex)
        {
            Log.LogMsg(ex.Message);
            oDs = null;
        }

        return oDs;
    }
    private void DoExport(Boolean bToCSV)
    {
        ClassReport oRep = new ClassReport();
        DataSet oDs = GetGridData();
        Boolean bOkay = false;

        this.RowError1.Visible = false;
        this.RowError2.Visible = false;

        if (oDs != null)
        {
            if (oDs.Tables.Count > 0)
            {
                if (oDs.Tables[0].Rows.Count > 0)
                {
                    bOkay = true;
                }
            }
        }

        if (bOkay == true)
        {
            RKLib.ExportData.Export oExp = new RKLib.ExportData.Export("Web");

            Int32[] Columns = { 0, 1, 2 };

            if (bToCSV == true)
            {
                //	Export to CSV file.

                oExp.ExportDetails(oDs.Tables[0], Columns, RKLib.ExportData.Export.ExportFormat.CSV, "Report.csv");
            }
            else
            {
                //	Export to Microsoft Excel.

                oExp.ExportDetails(oDs.Tables[0], Columns, RKLib.ExportData.Export.ExportFormat.Excel, "Report.xls");
            }
        }
        else
        {
            this.RowError1.Visible = true;
            this.RowError2.Visible = true;
            this.LblMsg.Text = "No Data Found!";
        }
    }
Exemplo n.º 38
0
        public static string GetHTMLString(ClassReport classReport, Class selectedClass, int session, string[] classSubjects)
        {
            var sb = new StringBuilder();

            sb.Append($@"
                        <html>
                            <head>
                            </head>
                            <body>
                                <div id='all-report-cards'>");

            foreach (var studentReport in classReport.StudentReports)
            {
                sb.Append($@"
                                    <div class='report-card'>
                                        <table align='center'> ");

                sb.Append($@"
                                            <tr>
                                                <td>
                                                    <h3 class='py-2'>{studentReport.StudentName}</h3>
                                                    <p>Class: {selectedClass.Name}</p>
                                                    <p>Session: {session}</p>
                                                </td>
                                            </tr>");

                sb.Append($@"
                                             <tr>
                                                <td>
                                                    <table>
                                                        <tr>
                                                            <th>First Term</th>
                                                            <th>Second Term</th>
                                                            <th>Third Term</th>
                                                        </tr>

                                                        <tr>
                                                        <td>");

                var firstTermReport = studentReport.TermReports.FirstOrDefault(x => x.Term == Term.FirstTerm);
                var firstTermStat   = classReport.ScoresStat.TermStats.FirstOrDefault(x => x.Term == Term.FirstTerm);

                sb.Append($@"
                                                            <table class='report-card-data'>
                                                                <colgroup>
                                                                    <col class='column-width-subject' />
                                                                    <col class='column-width' />
                                                                    <col class='column-width' />
                                                                    <col class='column-width' />
                                                                    <col class='column-width' />
                                                                    <col class='column-width' />
                                                                    <col class='column-width' />
                                                                    <col class='column-width' />
                                                                    <col class='column-width' />
                                                                    <col class='column-width' />
                                                                    <col class='column-width' />
                                                                </colgroup>
                                                                <tr class='vertical-align'>
                                                                    <th>Subject</th>
                                                                    <th>C.A</th>
                                                                    <th>1st Exam</th>
                                                                    <th>2nd Exam</th>
                                                                    <th>Homework</th>
                                                                    <th>Class Acts</th>
                                                                    <th>Total</th>
                                                                    <th>Class Min</th>
                                                                    <th>Class Max</th>
                                                                    <th>Class Ave</th>
                                                                    <th>Grade</th>
                                                                </tr>");

                foreach (var subject in classSubjects)
                {
                    var subjectReport = firstTermReport?.SubjectReports.FirstOrDefault(x => x.Subject == subject);
                    var subjectStat   = firstTermStat?.Stats.FirstOrDefault(x => x.Subject == subject);

                    sb.Append($@"
                                                                <tr class='report-card-data'>
                                                                    <td>{subject}</td>
                                                                    <td>{subjectReport?.CAScore}</td>
                                                                    <td>{subjectReport?.FirstExamScore}</td>
                                                                    <td>{subjectReport?.SecondExamScore}</td>
                                                                    <td>{subjectReport?.HomeworkScore}</td>
                                                                    <td>{subjectReport?.ClassActivitiesScore}</td>
                                                                    <td>{subjectReport?.WeightedScore}</td>
                                                                    <td>{subjectStat?.ClassMinScore}</td>
                                                                    <td>{subjectStat?.ClassMaxScore}</td>
                                                                    <td>{subjectStat?.ClassAverageScore}</td>
                                                                    <td>{subjectReport?.Grade}</td>
                                                                </tr>");
                }

                sb.Append($@"
                                                            </table>
                                                        </td>
                                                    
                                                    <td>");

                var secondTermReport = studentReport.TermReports.FirstOrDefault(x => x.Term == Term.SecondTerm);
                var secondTermStat   = classReport.ScoresStat.TermStats.FirstOrDefault(x => x.Term == Term.SecondTerm);

                sb.Append($@"
                                                            <table class='report-card-data'>
                                                                <colgroup>
                                                                    <col class='column-width-subject' />
                                                                    <col class='column-width' />
                                                                    <col class='column-width' />
                                                                    <col class='column-width' />
                                                                    <col class='column-width' />
                                                                    <col class='column-width' />
                                                                    <col class='column-width' />
                                                                    <col class='column-width' />
                                                                    <col class='column-width' />
                                                                    <col class='column-width' />
                                                                    <col class='column-width' />
                                                                </colgroup>
                                                                <tr class='vertical-align'>
                                                                    <th>Subject</th>
                                                                    <th>C.A</th>
                                                                    <th>1st Exam</th>
                                                                    <th>2nd Exam</th>
                                                                    <th>Homework</th>
                                                                    <th>Class Acts</th>
                                                                    <th>Total</th>
                                                                    <th>Class Min</th>
                                                                    <th>Class Max</th>
                                                                    <th>Class Ave</th>
                                                                    <th>Grade</th>
                                                                </tr>");

                foreach (var subject in classSubjects)
                {
                    var subjectReport = secondTermReport?.SubjectReports.FirstOrDefault(x => x.Subject == subject);
                    var subjectStat   = secondTermStat?.Stats.FirstOrDefault(x => x.Subject == subject);

                    sb.Append($@"
                                                                <tr class='report-card-data'>
                                                                    <td>{subject}</td>
                                                                    <td>{subjectReport?.CAScore}</td>
                                                                    <td>{subjectReport?.FirstExamScore}</td>
                                                                    <td>{subjectReport?.SecondExamScore}</td>
                                                                    <td>{subjectReport?.HomeworkScore}</td>
                                                                    <td>{subjectReport?.ClassActivitiesScore}</td>
                                                                    <td>{subjectReport?.WeightedScore}</td>
                                                                    <td>{subjectStat?.ClassMinScore}</td>
                                                                    <td>{subjectStat?.ClassMaxScore}</td>
                                                                    <td>{subjectStat?.ClassAverageScore}</td>
                                                                    <td>{subjectReport?.Grade}</td>
                                                                </tr>");
                }

                sb.Append($@"
                                                            </table>
                                                        </td>
                                                    
                                                    <td>");


                var thirdTermReport = studentReport.TermReports.FirstOrDefault(x => x.Term == Term.ThirdTerm);
                var thirdTermStat   = classReport.ScoresStat.TermStats.FirstOrDefault(x => x.Term == Term.ThirdTerm);

                sb.Append($@"
                                                            <table class='report-card-data'>
                                                                <colgroup>
                                                                    <col class='column-width-subject' />
                                                                    <col class='column-width' />
                                                                    <col class='column-width' />
                                                                    <col class='column-width' />
                                                                    <col class='column-width' />
                                                                    <col class='column-width' />
                                                                    <col class='column-width' />
                                                                    <col class='column-width' />
                                                                    <col class='column-width' />
                                                                    <col class='column-width' />
                                                                    <col class='column-width' />
                                                                </colgroup>
                                                                <tr class='vertical-align'>
                                                                    <th>Subject</th>
                                                                    <th>C.A</th>
                                                                    <th>1st Exam</th>
                                                                    <th>2nd Exam</th>
                                                                    <th>Homework</th>
                                                                    <th>Class Acts</th>
                                                                    <th>Total</th>
                                                                    <th>Class Min</th>
                                                                    <th>Class Max</th>
                                                                    <th>Class Ave</th>
                                                                    <th>Grade</th>
                                                                </tr>");

                foreach (var subject in classSubjects)
                {
                    var subjectReport = thirdTermReport?.SubjectReports.FirstOrDefault(x => x.Subject == subject);
                    var subjectStat   = thirdTermStat?.Stats.FirstOrDefault(x => x.Subject == subject);

                    sb.Append($@"
                                                                <tr class='report-card-data'>
                                                                    <td>{subject}</td>
                                                                    <td>{subjectReport?.CAScore}</td>
                                                                    <td>{subjectReport?.FirstExamScore}</td>
                                                                    <td>{subjectReport?.SecondExamScore}</td>
                                                                    <td>{subjectReport?.HomeworkScore}</td>
                                                                    <td>{subjectReport?.ClassActivitiesScore}</td>
                                                                    <td>{subjectReport?.WeightedScore}</td>
                                                                    <td>{subjectStat?.ClassMinScore}</td>
                                                                    <td>{subjectStat?.ClassMaxScore}</td>
                                                                    <td>{subjectStat?.ClassAverageScore}</td>
                                                                    <td>{subjectReport?.Grade}</td>
                                                                </tr>");
                }

                sb.Append($@"
                                        </table>
                                    </td> 
                                </tr>
                            </table>
                        </td>
                    </tr>");
            }

            sb.Append(@"
                                        </table>
                                    </div>
                                    <br />
                                </div>
                            </body>
                        </html>");



            return(sb.ToString());
        }
Exemplo n.º 39
0
 public override void IncrementCounterFor(ClassReport classReport)
 {
 }
Exemplo n.º 40
0
    private void ShowGrid(Int32 PageNo)
    {
        DateTime DateStart = this.cc2DateSelector.StartDate();
        DateTime DateEnd = this.cc2DateSelector.EndDate();

        this.LblFrom.Text = DateStart.ToString("dd MMM yyyy");
        this.LblTo.Text = DateEnd.ToString("dd MMM yyyy");

        ClassReport oRep = new ClassReport();
        DataSet oDs = oRep.GetTimeSheet(Int32.Parse(ViewState["UserId"].ToString()), DateStart, DateEnd);
        double dTotal = 0;

        foreach (DataRow oDr in oDs.Tables[0].Rows)
            dTotal += double.Parse(oDr["Hours"].ToString());

        ViewState["TotalHours"] = dTotal.ToString();

        this.GridTime.DataSource = oDs;
        this.GridTime.PageIndex = (PageNo >= 0) ? PageNo : 0;
        this.GridTime.DataBind();

        if (Int32.Parse(ViewState["TimeId"].ToString()) == 0)
        {
            this.BtnSubmit.Text = "Submit";
            this.LblTimeId.Text = "New";
        }
        else
        {
            this.BtnSubmit.Text = "Update";
            this.LblTimeId.Text = string.Format("Update ({0})", Int32.Parse(ViewState["TimeId"].ToString()));
        }

        //	Time events which are locked cannot be edited or deleted.

        ClassTime oTim = new ClassTime();

        foreach (GridViewRow oRow in GridTime.Rows)
        {
            ImageButton oDel = (ImageButton)oRow.FindControl("ImgTrash");

            if (oDel != null)
            {
                oTim.Load(Int32.Parse(oDel.CommandArgument));

                if (oTim.Locked)
                {
                    oDel.ToolTip = "";
                    oDel.Enabled = false;
                    oDel.ImageUrl = "~/Images/BlankIcon.gif";
                }
            }
        }

        ShowTimeError("");
    }
Exemplo n.º 41
0
 public override void IncrementCounterFor(ClassReport classReport)
 {
     classReport.SucceededTests++;
 }
Exemplo n.º 42
0
 private void ValidateMethodsExisting(ClassReport report)
 {
     report.MissingMethods          = methodsNotFound;
     report.ValidMethodsByExistence = methodPairs.Keys.ToList();
 }
Exemplo n.º 43
0
    public DataSet GetTimeSheet(string UsrNam, string UsrPwd, DateTime StartDate, DateTime EndDate)
    {
        DataSet oDs = null;

        try
        {
            Int32 UserId = GetUserId(UsrNam, UsrPwd);

            if (UserId > 0)
            {
                ClassReport oRep = new ClassReport();

                oDs = oRep.GetTimeSheet(UserId, StartDate, EndDate);
            }
        }

        catch (Exception ex)
        {
            Log.LogMsg(ex.Message);
        }

        return oDs;
    }