Пример #1
0
        private void toolStripMenuItem1_Click(object sender, EventArgs e)
        {
            var df = new DTRImportForm();

            df.MinimizeBox     = false;
            df.MaximizeBox     = false;
            df.FormBorderStyle = FormBorderStyle.FixedSingle;
            df.StartPosition   = FormStartPosition.CenterScreen;
            Enrollee enrollee = ActionClass.GetEnrollee(((JEnrollee)listBoxEnrollees.SelectedItem).EnrolleeId);

            df.OEnrollee = enrollee;
            df.IMonth    = toolStripComboBoxMonth.SelectedIndex + 1;
            df.IYear     = int.Parse(toolStripComboBoxDuration.Text);
            df.ShowDialog();
        }
Пример #2
0
        private void toolStripButtonImport_Click(object sender, EventArgs e)
        {
            var df = new DTRImportForm
            {
                MinimizeBox     = false,
                MaximizeBox     = false,
                FormBorderStyle = FormBorderStyle.FixedSingle,
                StartPosition   = FormStartPosition.CenterScreen,
                IMonth          = toolStripComboBoxMonth.SelectedIndex + 1,
                IYear           = int.Parse(toolStripComboBoxDuration.Text),
                SUserName       = SUserName,
                SCompanyName    = SCompanyName
            };
            Enrollee enrollee = ActionClass.GetEnrollee(((JEnrollee)listBoxEnrollees.SelectedItem).EnrolleeId);

            df.OEnrollee = enrollee;
            df.ShowDialog();
        }
Пример #3
0
        private void toolStripButtonSaveLogs_Click(object sender, EventArgs e)
        {
            if (macDumpLogBindingSource != null)
            {
                List <MacDumpLog> lMacs1 = DTRImportForm.LoadDumpLogs();
                List <MacDumpLog> lMacs2 = ActionClass.FillMacDumpLogEnrollee(OENrollee.EnrolleeId);
                List <MacDumpLog> lMacs3 = new List <MacDumpLog>();

                foreach (var log in lMacs1)
                {
                    MacDumpLog m =
                        lMacs2.FirstOrDefault(
                            ma => ((ma.MacDumpDate.Trim() == log.MacDumpDate.Trim()) && (ma.MacDumpTime.Trim() == log.MacDumpTime.Trim())));

                    if (m != null)
                    {
                        Console.WriteLine(m.MacDumpDate.ToString());
                    }
                    else
                    {
                        lMacs3.Add(log);
                    }
                }

                if (lMacs3.Count > 0)
                {
                    int iResult = ActionClass.SaveMacDumpLogAll(lMacs3);
                    if (iResult > 0)
                    {
                        toolStripStatusLabel1.Text = "Delinquent logs ported successfully.";
                    }
                    else
                    {
                        toolStripStatusLabel1.Text = "Error Occured while saving data to database or duplicate record already exists.";
                    }
                }
                else
                {
                    toolStripStatusLabel1.Text = "Record already exists.";
                }
            }
        }
Пример #4
0
 public void InitComponents()
 {
     macDumpLogBindingSource.DataSource = DTRImportForm.LoadDumpLogs();
     toolStripStatusLabel1.Text         = "(" + macDumpLogBindingSource.Count.ToString() + ") logs loaded.";
 }