Пример #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
 private void RefreshData()
 {
     try {
         var dataTable = Archiver.GetGuardsBasicData(Gid);
         GIDLBL.Text       = Gid.ToString();
         LNLBL.Text        = dataTable.Rows[0]["fn"] + " " + dataTable.Rows[0]["mn"];
         LLBL.Text         = dataTable.Rows[0]["ln"] + ", ";
         ContactNoLBL.Text = dataTable.Rows[0]["CellNo"].ToString();
         TelNoLBL.Text     = dataTable.Rows[0]["TelNo"].ToString();
         ContactLBL.Text   = dataTable.Rows[0]["EmergencyContact"].ToString();
         EmergencyLBL.Text = dataTable.Rows[0]["EmergencyNo"].ToString();
     }
     catch (Exception ex) {
         ShowErrorBox("Archive Guard - Loading", ex.Message);
     }
 }
Пример #3
0
 public void RefreshCurrent()
 {
     if (!Name.Equals("Archived"))
     {
         var dt = Scheduling.GetAssignmentDetails(Aid);
         LocationLBL.Text = dt.Rows[0][0].ToString();
         StartLBL.Text    = dt.Rows[0][1].ToString().Split(' ')[0];
         EndLBL.Text      = dt.Rows[0][2].ToString().Split(' ')[0];
     }
     else
     {
         var dt = Archiver.GetAssignmentDetails(Aid);
         LocationLBL.Text = dt.Rows[0][0].ToString();
         StartLBL.Text    = dt.Rows[0][1].ToString().Split(' ')[0];
         EndLBL.Text      = dt.Rows[0][2].ToString().Split(' ')[0];
     }
 }
Пример #4
0
        public void RefreshDutyDetails()
        {
            DutyDetailsGRD.DataSource = Name.Equals("Archived")
                ? Archiver.GetDutyDetailsSummary(Aid)
                : Name.Equals("History") ? Scheduling.GetDutyDetailsSummaryHistory(Aid): Scheduling.GetDutyDetailsSummary(Aid);
            DutyDetailsGRD.Columns[0].Visible    = false;
            DutyDetailsGRD.Columns[1].HeaderText = "TIME-IN";
            DutyDetailsGRD.Columns[2].HeaderText = "TIME-OUT";
            DutyDetailsGRD.Columns[3].HeaderText = "DAYS";
            DutyDetailsGRD.Columns[4].HeaderText = "EFFECTIVE";
            DutyDetailsGRD.Columns[5].HeaderText = "DISMISSED";

            DutyDetailsGRD.Columns[1].Width = 95;
            DutyDetailsGRD.Columns[2].Width = 95;
            DutyDetailsGRD.Columns[3].Width = 95;
            DutyDetailsGRD.Columns[4].Width = 100;
            DutyDetailsGRD.Columns[5].Width = 100;

            DutyDetailsGRD.Select();
        }
Пример #5
0
        private void LoadDetails()
        {
            try {
                PeriodCMBX.Items.Clear();
                if (!Name.Equals("Archived"))
                {
                    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())));
                    }
                }
                else
                {
                    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;
                    NoPayrollPNL.Visible     = false;
                }
                else
                {
                    NoPayrollPNL.BringToFront();
                    NoPayrollPNL.Visible = true;
                }
                if (OverviewPNL.Visible == false)
                {
                    ChangePanel(OverviewLBL, OverviewPNL);
                }
            }
            catch (Exception ex) {
                ShowErrorBox("Payroll Period Details", ex.Message);
            }
        }
Пример #6
0
        public void LoadComputations()
        {
            try {
                if (PeriodCMBX.Items.Count > 0)
                {
                    if (!Name.Equals("Archived"))
                    {
                        _pay = new Payroll(Gid, ((ComboBoxDays)PeriodCMBX.SelectedItem).Month,
                                           ((ComboBoxDays)PeriodCMBX.SelectedItem).Period,
                                           ((ComboBoxDays)PeriodCMBX.SelectedItem).Year);
                    }
                    else
                    {
                        _pay = Archiver.GetPayroll(Gid, ((ComboBoxDays)PeriodCMBX.SelectedItem).Month,
                                                   ((ComboBoxDays)PeriodCMBX.SelectedItem).Period,
                                                   ((ComboBoxDays)PeriodCMBX.SelectedItem).Year);
                    }
                    UpdatePopUp("nsu_proper_day_normal", "nsu_overtime_day_normal", "nsu_proper_night_normal",
                                "nsu_overtime_night_normal", MondaySaturday);
                    UpdatePopUp("sun_proper_day_normal", "sun_overtime_day_normal", "sun_proper_night_normal",
                                "sun_overtime_night_normal", Sundays);
                    UpdatePopUp("nsu_proper_day_special", "nsu_overtime_day_special", "nsu_proper_night_special",
                                "nsu_overtime_night_special", SMond);
                    UpdatePopUp("sun_proper_day_special", "sun_overtime_day_special", "sun_proper_night_special",
                                "sun_overtime_night_special", SSunds);
                    UpdatePopUp("nsu_proper_day_regular", "nsu_overtime_day_regular", "nsu_proper_night_regular",
                                "nsu_overtime_night_regular", RMond);
                    UpdatePopUp("sun_proper_day_regular", "sun_overtime_day_regular", "sun_proper_night_regular",
                                "sun_overtime_night_regular", RSunds);
                    UpdateLbl("normal_nsu", OMLBL);
                    UpdateLbl("normal_sun", OSLBL);
                    UpdateLbl("regular_nsu", RMLBL);
                    UpdateLbl("regular_sun", RSLBL);
                    UpdateLbl("special_nsu", SMLBL);
                    UpdateLbl("special_sun", SSLBL);
                    UpdateLbl("normal", OTLBL);
                    UpdateLbl("regular", RTLBL);
                    UpdateLbl("special", STLBL);
                    UpdateLbl("total", WorkTotalLBL);

                    B13LBL.Text        = CurrencyFormat(_pay.ThirteenthMonthPay);
                    BAllowanceLBL.Text = CurrencyFormat(_pay.EmergencyAllowance);
                    BBondsLBL.Text     = CurrencyFormat(_pay.CashBond);
                    BColaLBL.Text      = CurrencyFormat(_pay.Cola);
                    BTotalLBL.Text     = CurrencyFormat(_pay.Bonuses);

                    DCashAdvanceLBL.Text = CurrencyFormatNegative(_pay.CashAdvance);
                    DPagIbigLBL.Text     = CurrencyFormatNegative(_pay.PagIbig);
                    DPhilHealthLBL.Text  = CurrencyFormatNegative(_pay.PhilHealth);
                    DSSSLBL.Text         = CurrencyFormatNegative(_pay.Sss);
                    DTotalLBL.Text       = CurrencyFormatNegative(_pay.Deductions);

                    NetPayLBL.Text = CurrencyFormat(_pay.NetPay);

                    var wt = _pay.GetWithholdingTax();
                    TaxPop.Items[1].Text = CurrencyFormat(wt.TaxbaseD);
                    TaxPop.Items[3].Text = CurrencyFormat(wt.ExcessTax);
                    TaxPop.Items[5].Text = CurrencyFormat(wt.total);

                    string[] sssdetails = _pay.GetSSSDetails();
                    SSSPop.Items[1].Text = sssdetails[0];
                    SSSPop.Items[3].Text = sssdetails[1];
                    SSSPop.Items[5].Text = sssdetails[2];
                    DWithLBL.Text        = CurrencyFormatNegative(wt.total);
                }
            }
            catch (Exception ex) {
                rylui.RylMessageBox.ShowDialog("This guard has no Approved payrolls archived.", "Payroll Calculations", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Пример #7
0
        public void RefreshAttendance()
        {
            try {
                if (!Name.Equals("Archived"))
                {
                    AttendanceGRD.DataSource = _attendance.GetAttendance_View(
                        ((ComboBoxDays)PeriodCMBX.SelectedItem).Month,
                        ((ComboBoxDays)PeriodCMBX.SelectedItem).Period, ((ComboBoxDays)PeriodCMBX.SelectedItem).Year);
                    AttendanceGRD.Columns[8].Visible  = false;
                    AttendanceGRD.Columns[9].Visible  = false;
                    AttendanceGRD.Columns[10].Visible = false;
                    AttendanceGRD.Columns[11].Visible = false;
                }
                else
                {
                    AttendanceGRD.DataSource = Archiver.GetAttendance(Gid,
                                                                      ((ComboBoxDays)PeriodCMBX.SelectedItem).Month,
                                                                      ((ComboBoxDays)PeriodCMBX.SelectedItem).Period, ((ComboBoxDays)PeriodCMBX.SelectedItem).Year);
                }

                AttendanceGRD.Columns[0].Visible = false;
                AttendanceGRD.Columns[1].Visible = false;
                AttendanceGRD.Columns[2].Width   = 140;
                AttendanceGRD.Sort(AttendanceGRD.Columns[2], ListSortDirection.Ascending);
                AttendanceGRD.Columns[2].HeaderText = "DAY / SCHEDULE";
                AttendanceGRD.Columns[3].Width      = 120;
                AttendanceGRD.Columns[3].HeaderText = "IN-OUT";
                AttendanceGRD.Columns[3].SortMode   = DataGridViewColumnSortMode.NotSortable;
                AttendanceGRD.Columns[4].Width      = 50;
                AttendanceGRD.Columns[4].HeaderText = "RD";
                AttendanceGRD.Columns[4].SortMode   = DataGridViewColumnSortMode.NotSortable;
                AttendanceGRD.Columns[5].Width      = 50;
                AttendanceGRD.Columns[5].HeaderText = "RN";
                AttendanceGRD.Columns[5].SortMode   = DataGridViewColumnSortMode.NotSortable;
                AttendanceGRD.Columns[6].Width      = 50;
                AttendanceGRD.Columns[6].HeaderText = "HD";
                AttendanceGRD.Columns[6].SortMode   = DataGridViewColumnSortMode.NotSortable;
                AttendanceGRD.Columns[7].Width      = 60;
                AttendanceGRD.Columns[7].HeaderText = "HN";
                AttendanceGRD.Columns[7].SortMode   = DataGridViewColumnSortMode.NotSortable;
                AttendanceGRD.Columns[7].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;



                if (!Name.Equals("Archived"))
                {
                    var attendance = new Attendance(Aid, ((ComboBoxDays)PeriodCMBX.SelectedItem).Month,
                                                    ((ComboBoxDays)PeriodCMBX.SelectedItem).Period, ((ComboBoxDays)PeriodCMBX.SelectedItem).Year);
                    var hrs = attendance.GetAttendanceSummary();
                    AShiftLBL.Text  = hrs.GetNormalDay() + " hrs";
                    ANightLBL.Text  = hrs.GetNormalNight() + " hrs";
                    AHShiftLBL.Text = hrs.GetHolidayDay() + " hrs";
                    AHNightLBL.Text = hrs.GetHolidayNight() + " hrs";


                    ACertifiedLBL.Text = attendance.GetCertifiedBy().Equals("")
                        ? "Unedited Attendance"
                        : attendance.GetCertifiedBy();

                    try {
                        string[] tooltip = attendance.GetAttendanceTooltip();

                        OrdinaryDay.Items[3].Text = tooltip[0];
                        OrdinaryDay.Items[4].Text = tooltip[1];
                        OrdinaryDay.Items[6].Text = tooltip[2];
                        OrdinaryDay.Items[7].Text = tooltip[3];

                        OrdinaryNight.Items[3].Text = tooltip[4];
                        OrdinaryNight.Items[4].Text = tooltip[5];
                        OrdinaryNight.Items[6].Text = tooltip[6];
                        OrdinaryNight.Items[7].Text = tooltip[7];

                        HolidayDay.Items[3].Text  = tooltip[8];
                        HolidayDay.Items[4].Text  = tooltip[9];
                        HolidayDay.Items[6].Text  = tooltip[10];
                        HolidayDay.Items[7].Text  = tooltip[11];
                        HolidayDay.Items[11].Text = tooltip[12];
                        HolidayDay.Items[12].Text = tooltip[13];
                        HolidayDay.Items[14].Text = tooltip[14];
                        HolidayDay.Items[15].Text = tooltip[15];

                        HolidayNight.Items[3].Text  = tooltip[16];
                        HolidayNight.Items[4].Text  = tooltip[17];
                        HolidayNight.Items[6].Text  = tooltip[18];
                        HolidayNight.Items[7].Text  = tooltip[19];
                        HolidayNight.Items[11].Text = tooltip[20];
                        HolidayNight.Items[12].Text = tooltip[21];
                        HolidayNight.Items[14].Text = tooltip[22];
                        HolidayNight.Items[15].Text = tooltip[23];
                    }
                    catch (Exception exception) {
                        Console.WriteLine(exception);
                    }
                }
                else
                {
                    var attendance = Archiver.GetAttendanceSummary(((ComboBoxDays)PeriodCMBX.SelectedItem).Year,
                                                                   ((ComboBoxDays)PeriodCMBX.SelectedItem).Month,
                                                                   ((ComboBoxDays)PeriodCMBX.SelectedItem).Period, Gid);

                    AShiftLBL.Text  = attendance.Rows[0][4] + " hrs";
                    ANightLBL.Text  = attendance.Rows[0][5] + " hrs";
                    AHShiftLBL.Text = attendance.Rows[0][2] + " hrs";
                    AHNightLBL.Text = attendance.Rows[0][3] + " hrs";


                    ACertifiedLBL.Text = attendance.Rows[0][1].ToString();

                    try {
                        string[] tooltip = Archiver.GetAttendanceTooltip(Gid, ((ComboBoxDays)PeriodCMBX.SelectedItem).Period, ((ComboBoxDays)PeriodCMBX.SelectedItem).Month, ((ComboBoxDays)PeriodCMBX.SelectedItem).Year);

                        OrdinaryDay.Items[3].Text = tooltip[0];
                        OrdinaryDay.Items[4].Text = tooltip[1];
                        OrdinaryDay.Items[6].Text = tooltip[2];
                        OrdinaryDay.Items[7].Text = tooltip[3];

                        OrdinaryNight.Items[3].Text = tooltip[4];
                        OrdinaryNight.Items[4].Text = tooltip[5];
                        OrdinaryNight.Items[6].Text = tooltip[6];
                        OrdinaryNight.Items[7].Text = tooltip[7];

                        HolidayDay.Items[3].Text  = tooltip[8];
                        HolidayDay.Items[4].Text  = tooltip[9];
                        HolidayDay.Items[6].Text  = tooltip[10];
                        HolidayDay.Items[7].Text  = tooltip[11];
                        HolidayDay.Items[11].Text = tooltip[12];
                        HolidayDay.Items[12].Text = tooltip[13];
                        HolidayDay.Items[14].Text = tooltip[14];
                        HolidayDay.Items[15].Text = tooltip[15];

                        HolidayNight.Items[3].Text  = tooltip[16];
                        HolidayNight.Items[4].Text  = tooltip[17];
                        HolidayNight.Items[6].Text  = tooltip[18];
                        HolidayNight.Items[7].Text  = tooltip[19];
                        HolidayNight.Items[11].Text = tooltip[20];
                        HolidayNight.Items[12].Text = tooltip[21];
                        HolidayNight.Items[14].Text = tooltip[22];
                        HolidayNight.Items[15].Text = tooltip[23];
                    }
                    catch (Exception exception) {
                        Console.WriteLine(exception);
                    }
                }
            } catch (Exception e) {
                Console.WriteLine(e.Message);
            }
        }
Пример #8
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);
            }
        }