示例#1
0
        public void RefreshData()
        {
            PeriodCMBX.Items.Clear();
            if (!Name.Equals("Archived"))
            {
                var dt = Scheduling.GetAllAssignmentDetails(Aid);
                NameLBL.Text      = dt.Rows[0][2].ToString().Split(',')[0] + ",";
                FirstNameLBL.Text = dt.Rows[0][2].ToString().Split(',')[1];
                ClientLBL.Text    = dt.Rows[0][3].ToString();

                foreach (DataRow row in Attendance.GetPeriods(Gid).Rows)
                {
                    PeriodCMBX.Items.Add(new ComboBoxDays(int.Parse(row["month"].ToString()),
                                                          int.Parse(row["period"].ToString()), int.Parse(row["year"].ToString())));
                }
                if (PeriodCMBX.Items.Count > 0)
                {
                    PeriodCMBX.SelectedIndex = 0;
                }
            }
            else
            {
                var dt = Archiver.GetAllAssignmentDetails(Aid);
                NameLBL.Text      = dt.Rows[0][2].ToString().Split(',')[0] + ",";
                FirstNameLBL.Text = dt.Rows[0][2].ToString().Split(',')[1];
                ClientLBL.Text    = dt.Rows[0][3].ToString();


                foreach (DataRow row in Archiver.GetPeriods(Gid).Rows)
                {
                    PeriodCMBX.Items.Add(new ComboBoxDays(int.Parse(row["month"].ToString()),
                                                          int.Parse(row["period"].ToString()), int.Parse(row["year"].ToString())));
                }
                if (PeriodCMBX.Items.Count > 0)
                {
                    PeriodCMBX.SelectedIndex = 0;
                }
            }
            if (DutyDetailsGRD.Rows.Count == 0)
            {
                ErrorPNL.Visible = true;
                ErrorPNL.BringToFront();
            }
            else
            {
                ErrorPNL.Visible = false;
            }
        }
示例#2
0
        public void RefreshData()
        {
            try {
                var dt = Client.GetClientDetails(Cid);
                NameLBL.Text     = dt.Rows[0]["name"].ToString();
                CIDLBL.Text      = dt.Rows[0]["CID"].ToString();
                LocationLBL.Text = dt.Rows[0]["ClientStreetNo"] + " " + dt.Rows[0]["ClientStreet"] + ", " +
                                   dt.Rows[0]["ClientBrgy"] + ", " + dt.Rows[0]["ClientBrgy"] + ", " +
                                   dt.Rows[0]["ClientCity"];
                ManagerLBL.Text   = dt.Rows[0]["Manager"].ToString();
                ContactLBL.Text   = dt.Rows[0]["ContactPerson"].ToString();
                ContactNoLBL.Text = dt.Rows[0]["ContactNo"].ToString();
                BasicPayLBL.Text  = "₱ " + dt.Rows[0]["ofcrate"];
                try {
                    CertifiersGRD.DataSource           = Client.GetCertifiersView(Cid);
                    CertifiersGRD.Columns[0].Visible   = false;
                    CertifiersGRD.Columns[1].Visible   = false;
                    CertifiersGRD.Columns[2].Width     = 220;
                    CertifiersGRD.Columns[3].Width     = 150;
                    CertifiersGRD.ColumnHeadersVisible = false;

                    if (CertifiersGRD.Rows.Count == 0)
                    {
                        ErrorPNL.BringToFront();
                        ErrorPNL.Visible = true;
                    }
                    else
                    {
                        ErrorPNL.Visible = false;
                    }
                }
                catch (Exception ex) {
                    Console.WriteLine(ex);
                }
            }
            catch (Exception ex) {
                ShowErrorBox("Loading Error", ex.Message);
            }
        }
示例#3
0
        public void RefreshData()
        {
            try {
                if (!Name.Equals("Archived"))
                {
                    try {
                        _dataTable          = Guard.GetGuardsBasicData(Gid);
                        GIDLBL.Text         = _dataTable.Rows[0]["gtype"].ToString().Equals("0") ? "Regular" : "Officer";
                        LNLBL.Text          = _dataTable.Rows[0]["fn"] + " " + _dataTable.Rows[0]["mn"];
                        LLBL.Text           = _dataTable.Rows[0]["ln"] + ", ";
                        StatusLBL.Text      = GetStatus(_dataTable);
                        BdateLBL.Text       = _dataTable.Rows[0]["Bdate"].ToString();
                        GenderLBL.Text      = GetGender(_dataTable);
                        HeightLBL.Text      = _dataTable.Rows[0]["Height"].ToString();
                        WeightLBL.Text      = _dataTable.Rows[0]["Weight"].ToString();
                        ReligionLBL.Text    = _dataTable.Rows[0]["Religion"].ToString();
                        CivilStatusLBL.Text = GetCivilStatus(_dataTable);
                        ContactNoLBL.Text   = _dataTable.Rows[0]["CellNo"].ToString();
                        TelNoLBL.Text       = _dataTable.Rows[0]["TelNo"].ToString();
                        LicenseNoLBL.Text   = _dataTable.Rows[0]["LicenseNo"].ToString();
                        SSSLBL.Text         = _dataTable.Rows[0]["SSS"].ToString();
                        TINLBL.Text         = _dataTable.Rows[0]["TIN"].ToString();
                        PhilHealthLBL.Text  = _dataTable.Rows[0]["PhilHealth"].ToString();
                        PrevAgencyLBL.Text  = _dataTable.Rows[0]["PrevAgency"].ToString();
                        PrevAssLVL.Text     = _dataTable.Rows[0]["PrevAss"].ToString();
                        EdAtLBL.Text        = GetEducationalAttainment(_dataTable);
                        CourseLBL.Text      = _dataTable.Rows[0]["Course"].ToString();
                        TrainLBL.Text       = _dataTable.Rows[0]["MilitaryTrainings"].ToString();
                        ContactLBL.Text     = _dataTable.Rows[0]["EmergencyContact"].ToString();
                        EmergencyLBL.Text   = _dataTable.Rows[0]["EmergencyNo"].ToString();
                    }
                    catch (Exception ex) { Console.WriteLine(ex); }

                    try {
                        _dataTable         = Guard.GetGuardsAddresses(Gid);
                        BirthplaceLBL.Text = BuildStreet(_dataTable, 0);
                        PermAddLBL.Text    = BuildStreet(_dataTable, 1);
                        TempAddLBL.Text    = BuildStreet(_dataTable, 2);
                    }
                    catch (Exception ex) { Console.WriteLine(ex); }
                    try {
                        _dataTable     = Guard.GetGuardsParents(Gid);
                        MotherLBL.Text = BuildName(_dataTable, 1);
                        FatherLBL.Text = BuildName(_dataTable, 0);
                        try {
                            SpouseLBL.Text = BuildName(_dataTable, 2);
                        }
                        catch (Exception ex) { Console.WriteLine(ex); }
                    }
                    catch (Exception ex) { Console.WriteLine(ex); }
                    try {
                        DependentsGRD.DataSource         = Guard.GetGuardsDependentsView(Gid);
                        DependentsGRD.Columns[0].Visible = false;
                        DependentsGRD.Columns[1].Width   = 250;
                        DependentsGRD.Columns[2].Width   = 150;

                        if (DependentsGRD.Rows.Count == 0)
                        {
                            ErrorPNL.BringToFront();
                            ErrorPNL.Visible = true;
                        }
                        else
                        {
                            ErrorPNL.Visible = false;
                        }
                    }
                    catch (Exception ex) { Console.WriteLine(ex); }
                }
                else
                {
                    try {
                        _dataTable          = Archiver.GetGuardsBasicData(Gid);
                        GIDLBL.Text         = _dataTable.Rows[0]["gtype"].Equals("0") ? "Regular" : "Officer";
                        LNLBL.Text          = _dataTable.Rows[0]["fn"] + " " + _dataTable.Rows[0]["mn"];
                        LLBL.Text           = _dataTable.Rows[0]["ln"] + ", ";
                        StatusLBL.Text      = "Archived";
                        BdateLBL.Text       = _dataTable.Rows[0]["Bdate"].ToString();
                        GenderLBL.Text      = GetGender(_dataTable);
                        HeightLBL.Text      = _dataTable.Rows[0]["Height"].ToString();
                        WeightLBL.Text      = _dataTable.Rows[0]["Weight"].ToString();
                        ReligionLBL.Text    = _dataTable.Rows[0]["Religion"].ToString();
                        CivilStatusLBL.Text = GetCivilStatus(_dataTable);
                        ContactNoLBL.Text   = _dataTable.Rows[0]["CellNo"].ToString();
                        TelNoLBL.Text       = _dataTable.Rows[0]["TelNo"].ToString();
                        LicenseNoLBL.Text   = _dataTable.Rows[0]["LicenseNo"].ToString();
                        SSSLBL.Text         = _dataTable.Rows[0]["SSS"].ToString();
                        TINLBL.Text         = _dataTable.Rows[0]["TIN"].ToString();
                        PhilHealthLBL.Text  = _dataTable.Rows[0]["PhilHealth"].ToString();
                        PrevAgencyLBL.Text  = _dataTable.Rows[0]["PrevAgency"].ToString();
                        PrevAssLVL.Text     = _dataTable.Rows[0]["PrevAss"].ToString();
                        EdAtLBL.Text        = GetEducationalAttainment(_dataTable);
                        CourseLBL.Text      = _dataTable.Rows[0]["Course"].ToString();
                        TrainLBL.Text       = _dataTable.Rows[0]["MilitaryTrainings"].ToString();
                        ContactLBL.Text     = _dataTable.Rows[0]["EmergencyContact"].ToString();
                        EmergencyLBL.Text   = _dataTable.Rows[0]["EmergencyNo"].ToString();
                    }
                    catch (Exception ex) { Console.WriteLine(ex); }

                    try {
                        _dataTable         = Archiver.GetGuardsAddresses(Gid);
                        BirthplaceLBL.Text = BuildStreet(_dataTable, 0);
                        PermAddLBL.Text    = BuildStreet(_dataTable, 1);
                        TempAddLBL.Text    = BuildStreet(_dataTable, 2);
                    }
                    catch (Exception ex) { Console.WriteLine(ex); }
                    try {
                        _dataTable     = Archiver.GetGuardsParents(Gid);
                        MotherLBL.Text = BuildName(_dataTable, 1);
                        FatherLBL.Text = BuildName(_dataTable, 0);
                        try {
                            SpouseLBL.Text = BuildName(_dataTable, 2);
                        }
                        catch (Exception ex) { Console.WriteLine(ex); }
                    }
                    catch (Exception ex) { Console.WriteLine(ex); }
                    try {
                        DependentsGRD.DataSource         = Archiver.GetGuardsDependentsView(Gid);
                        DependentsGRD.Columns[0].Visible = false;
                        DependentsGRD.Columns[1].Width   = 250;
                        DependentsGRD.Columns[2].Width   = 150;

                        if (DependentsGRD.Rows.Count == 0)
                        {
                            ErrorPNL.BringToFront();
                            ErrorPNL.Visible = true;
                        }
                        else
                        {
                            ErrorPNL.Visible = false;
                        }
                    }
                    catch (Exception ex) { Console.WriteLine(ex); }
                }
            }
            catch (Exception ex) {
                ShowErrorBox("Laoding Guards", ex.Message);
            }
        }