Exemplo n.º 1
0
        public static int Save(Miscellaneou miscellaneou)
        {
            var a = new Miscellaneou
            {
                MiscellaneousId       = miscellaneou.MiscellaneousId,
                MiscGraceInAM         = miscellaneou.MiscGraceInAM,
                MiscGraceInPM         = miscellaneou.MiscGraceInPM,
                MiscGraceOT           = miscellaneou.MiscGraceOT,
                MiscRegularHours      = miscellaneou.MiscRegularHours,
                MiscOverRegularLabel  = miscellaneou.MiscOverRegularLabel,
                MiscUnderRegularLabel = miscellaneou.MiscUnderRegularLabel,
                MiscActive            = miscellaneou.MiscActive
            };

            using (_d = new DataRepository <Miscellaneou>())
            {
                if (miscellaneou.MiscellaneousId > 0)
                {
                    _d.Update(a);
                }
                else
                {
                    _d.Add(a);
                }

                _d.SaveChanges();
            }

            return(a.MiscellaneousId);
        }
Exemplo n.º 2
0
        private void LoadDRTEnrolleeId()
        {
            Cursor = Cursors.WaitCursor;
            if (listBoxEnrollees.Items.Count > 0)
            {
                textBoxName.Text = listBoxEnrollees.Text;
                iMonth           = toolStripComboBoxMonth.SelectedIndex + 1;
                iYear            = int.Parse(toolStripComboBoxDuration.Text);

                textBoxDepartment.Text = GetEnrolleeDepartment();
                textBoxPosition.Text   = GetEnrolleePosition();
                Miscellaneou misc = ActionClass.FillMiscellaneous().FirstOrDefault(mi => mi.MiscActive == true);

                int      iEnrolleeId = ((JEnrollee)listBoxEnrollees.SelectedItem).EnrolleeId;
                Enrollee enrollee    = ActionClass.GetEnrollee(iEnrolleeId);

                lDTRSource = DataManagementClass.LoadDTRViaDTR(enrollee, iMonth, iYear, ActionClass.FillDTRs(iEnrolleeId), misc);
                dTRsBindingSource.DataSource = lDTRSource;

                ExecuteSaveDTRThread(); // loop to save dtr.

                MarkUnderOverTimeHours();
            }
            Cursor = Cursors.Default;
        }
Exemplo n.º 3
0
        public static bool Delete(Miscellaneou miscellaneou)
        {
            using (_d = new DataRepository <Miscellaneou>())
            {
                _d.Delete(miscellaneou);
                _d.SaveChanges();
            }

            return(true);
        }
Exemplo n.º 4
0
        private void LoadDRTEnrollee(JEnrollee en, Miscellaneou misc)
        {
            Cursor = Cursors.WaitCursor;
            if (listBox1.Items.Count > 0)
            {
                var      eName    = en.GetFullName;
                Enrollee enrollee = ActionClass.GetEnrollee(en.EnrolleeId);

                List <ObjectManager.JDTR> lDTRSource01 = DataManagementClass.LoadDTRViaDTRBatch(enrollee, iMonth, iStartDay, iEndDay, iYear, ActionClass.FillDTRs(en.EnrolleeId), misc, eName, labelDuration.Text);

                lDTRSource.AddRange(lDTRSource01 as IEnumerable <JDTR>);
            }
            Cursor = Cursors.Default;
        }
Exemplo n.º 5
0
        private void buttonFinish_Click(object sender, EventArgs e)
        {
            Miscellaneou misc = ActionClass.FillMiscellaneous().FirstOrDefault(mi => mi.MiscActive == true);

            foreach (var item in listEnrollee)
            {
                LoadDRTEnrollee(item, misc);
            }
            MessageBox.Show(lDTRSource.Count.ToString() + @" Record(s) found. Press Ok to continue.", @"Records", MessageBoxButtons.OK, MessageBoxIcon.Information);
            if (lDTRSource.Count > 0)
            {
                var f = new WizardRepportForm();
                f.LoadData(lDTRSource);
                f.Show();
            }
        }