Ejemplo n.º 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;
            }
        }
Ejemplo n.º 2
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);
            }
        }