Exemple #1
0
 public WorldEmployee( DateTime beginTime, DateTime endTime, World world, Employee employee )
 {
     this._beginTime = beginTime;
     this._endTime = endTime;
     this._world = world;
     this._employee = employee;
 }
Exemple #2
0
 private void ucEmployeeSelectGrid1_EmployeeSelected(Baumax.Domain.Employee empl)
 {
     if (empl != null)
     {
         DialogResult = DialogResult.OK;
     }
 }
        public EmployeeBusinessObject(Employee employee, DateTime date)
        {
            if (employee == null)
                throw new ArgumentNullException();

            _employee = employee;
            DateOfInit = date;
        }
Exemple #4
0
 /// <summary>
 /// Add new item
 /// </summary>
 public override void Add()
 {
     Employee emp = new Employee();
     using (EmployeeFrm frm = new EmployeeFrm())
     {
         frm.Entity = emp;
         if (frm.ShowDialog(this) == DialogResult.OK)
         {
             if (emp.ID == 0)
             {
                 try
                 {
                     ClientEnvironment.EmployeeService.Save(emp);
                 }
                 catch (EntityException ex)
                 {
                     // 2think: what details should we show?
                     // 2think: how to localize?
                     using (FrmEntityExceptionDetails form = new FrmEntityExceptionDetails(ex))
                     {
                         form.Text = GetLocalized("CannotSaveEmployee");
                         form.ShowDialog(this);
                     }
                 }
             }
             else
             {
                 try
                 {
                     ClientEnvironment.EmployeeService.SaveOrUpdate(emp);
                 }
                 catch (EntityException ex)
                 {
                     // 2think: what details should we show?
                     // 2think: how to localize?
                     using (FrmEntityExceptionDetails form = new FrmEntityExceptionDetails(ex))
                     {
                         form.Text = GetLocalized("CannotSaveEmployee");
                         form.ShowDialog(this);
                     }
                 }
             }
             RefreshData();
         }
     }
 }
Exemple #5
0
        public EmployeeHolidaysInfo UpdateFromEmployee(Employee employee)
        {
            if (employee == null) return null;
            if (employee.IsNew) return null;
            if (EmployeeId != employee.ID) return null;

            EmployeeHolidaysInfo entity = GetEntity(EmployeeId, Year);

            if (entity == null)
            {
                entity = new EmployeeHolidaysInfo();
            }
            entity.EmployeeID = employee.ID;
            entity.NewHolidays = employee.NewHolidays;
            entity.OldHolidays = employee.OldHolidays;
            entity.UsedHolidays = employee.UsedHolidays;
            entity.Year = (short)Year;
            entity.CalculateSpareHolidays();
            Srv.SaveOrUpdate(entity);

            return entity;
        }
        public virtual void FillFromEmployee(Employee employee)
        {
            if (employee == null)
                throw new ArgumentNullException();

            NewHolidays = employee.NewHolidays;
            OldHolidays = employee.OldHolidays;
            SpareHolidaysExc = employee.SpareHolidaysExc;
            SpareHolidaysInc = employee.SpareHolidaysInc;

            EmployeeID = employee.ID;
        }
        public virtual void FillEmployee(Employee employee)
        {
            if (employee == null)
                throw new ArgumentNullException();

            employee.NewHolidays = NewHolidays;
            employee.OldHolidays = OldHolidays;
            employee.AvailableHolidays = NewHolidays + OldHolidays;
            employee.UsedHolidays = UsedHolidays;
            employee.SpareHolidaysExc = SpareHolidaysExc;
            employee.SpareHolidaysInc = SpareHolidaysInc;

            Debug.Assert(UsedHolidays == TakenHolidays + PlannedHolidays);
        }
 public EmployeeBusinessObject(long emplid)
 {
     _employee = ServerEnvironment.EmployeeService.FindById(emplid);
     AustriaEmployee = ServerEnvironment.CountryService.AustriaCountryID == ServerEnvironment.StoreService.GetCountryByStoreId(_employee.MainStoreID);
     DateOfInit = DateTime.Today;
 }
Exemple #9
0
        private void testEmployee()
        {
            login();
            List<Store> storelist= _StoreService.FindAll();

            Employee e = new Employee();
            e.PersID = "new2";
            e.FirstName = "Шура";
            e.LastName = "Мархонько";
            e.Import = false;
            e.CreateDate = DateTime.Now;
            if (storelist.Count > 0)
                e.MainStoreID = storelist[0].ID;
            e.OldHolidays = 7;
            e.NewHolidays = 55;
            e.BalanceHours = 78;
            e.ContractBegin = DateTime.Now;
            e.ContractEnd = DateTime.Now.AddYears(5);
            e.ContractWorkingHours = 12;
            try
            {
                e = _EmployeeService.Save(e);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }