Esempio n. 1
0
        private void butAdj_Click(object sender, EventArgs e)
        {
            if (!Security.IsAuthorized(Permissions.TimecardsEditAll))
            {
                return;
            }
            TimeAdjust adjust = new TimeAdjust();

            adjust.EmployeeNum = EmployeeCur.EmployeeNum;
            DateTime dateStop = PIn.PDate(textDateStop.Text);

            if (DateTime.Today <= dateStop && DateTime.Today >= PIn.PDate(textDateStart.Text))
            {
                adjust.TimeEntry = DateTime.Now;
            }
            else
            {
                adjust.TimeEntry = new DateTime(dateStop.Year, dateStop.Month, dateStop.Day,
                                                DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second);
            }
            FormTimeAdjustEdit FormT = new FormTimeAdjustEdit(adjust);

            FormT.IsNew = true;
            FormT.ShowDialog();
            if (FormT.DialogResult == DialogResult.Cancel)
            {
                return;
            }
            FillMain(true);
        }
Esempio n. 2
0
 private void gridMain_CellDoubleClick(object sender, ODGridClickEventArgs e)
 {
     timer1.Enabled = false;
     if (gridMain.Rows[e.Row].Tag.GetType() == typeof(TimeAdjust))
     {
         if (!Security.IsAuthorized(Permissions.TimecardsEditAll))
         {
             timer1.Enabled = true;
             return;
         }
         TimeAdjust         adjust = (TimeAdjust)gridMain.Rows[e.Row].Tag;
         FormTimeAdjustEdit FormT  = new FormTimeAdjustEdit(adjust);
         FormT.ShowDialog();
     }
     else
     {
         ClockEvent         ce      = (ClockEvent)gridMain.Rows[e.Row].Tag;
         FormClockEventEdit FormCEE = new FormClockEventEdit(ce);
         FormCEE.ShowDialog();
     }
     FillMain(true);
     timer1.Enabled = true;
 }
Esempio n. 3
0
 private void gridMain_CellDoubleClick(object sender,ODGridClickEventArgs e)
 {
     if(cannotEdit) {
         return;
     }
     timer1.Enabled=false;
     if(gridMain.Rows[e.Row].Tag.GetType()==typeof(TimeAdjust)) {
         if(!Security.IsAuthorized(Permissions.TimecardsEditAll)) {
             timer1.Enabled=true;
             return;
         }
         TimeAdjust adjust=(TimeAdjust)gridMain.Rows[e.Row].Tag;
         FormTimeAdjustEdit FormT=new FormTimeAdjustEdit(adjust);
         FormT.ShowDialog();
     }
     else {
         ClockEvent ce=(ClockEvent)gridMain.Rows[e.Row].Tag;
         FormClockEventEdit FormCEE=new FormClockEventEdit(ce);
         FormCEE.ShowDialog();
     }
     FillMain(true);
     timer1.Enabled=true;
 }
Esempio n. 4
0
 private void butAdj_Click(object sender,EventArgs e)
 {
     if(!Security.IsAuthorized(Permissions.TimecardsEditAll)) {
         return;
     }
     TimeAdjust adjust=new TimeAdjust();
     adjust.EmployeeNum=EmployeeCur.EmployeeNum;
     DateTime dateStop=PIn.Date(textDateStop.Text);
     if(DateTime.Today<=dateStop && DateTime.Today>=PIn.Date(textDateStart.Text)) {
         adjust.TimeEntry=DateTime.Now;
     }
     else {
         adjust.TimeEntry=new DateTime(dateStop.Year,dateStop.Month,dateStop.Day,
             DateTime.Now.Hour,DateTime.Now.Minute,DateTime.Now.Second);
     }
     FormTimeAdjustEdit FormT=new FormTimeAdjustEdit(adjust);
     FormT.IsNew=true;
     FormT.ShowDialog();
     if(FormT.DialogResult==DialogResult.Cancel) {
         return;
     }
     FillMain(true);
 }