protected void ASPxGridViewNomina_CustomDataCallback(object sender, ASPxGridViewCustomDataCallbackEventArgs e) { DevExpress.Web.ASPxGridView grid = (DevExpress.Web.ASPxGridView)sender; object employeeID = e.Parameters; string clave = employeeID.ToString().Trim(); //se obtiene el empleado mediante el ID EmployeeBusinessObject _EmployeeBAL = new EmployeeBusinessObject(); EmployeeEntityOnject _EmployeeInfo = _EmployeeBAL.GetEmployee(clave); if (_EmployeeInfo != null) { e.Result = new string[] { _EmployeeInfo.Clave, _EmployeeInfo.NombreCompleto }; } }
protected void ASPxGridViewNomina_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e) { ASPxGridView grid = (ASPxGridView)sender; ASPxComboBox cmb = (ASPxComboBox)grid.FindEditRowCellTemplateControl((GridViewDataColumn)grid.Columns["ClaveTrabajador"], "cmbEmployee"); e.NewValues["ClaveTrabajador"] = cmb.Text; e.NewValues["ClaveConcepto"] = ((ASPxGridView)sender).GetMasterRowKeyValue(); //se obtiene la empresa del trabajador seleccionado EmployeeBusinessObject _EmployeeBAL = new EmployeeBusinessObject(); EmployeeEntityOnject _EmployeeInfo = _EmployeeBAL.GetEmployee(e.NewValues["ClaveTrabajador"].ToString()); PeriodoBusinessObject _PeriodoBAL = new PeriodoBusinessObject(); PeriodoEntityObject _PeriodoInfo = _PeriodoBAL.GetPeriodoActualByNominaEmpresa(_EmployeeInfo.ClaveNomina, _EmployeeInfo.Empresa.Clave); e.NewValues["Empresa"] = _EmployeeInfo.Empresa.Clave; e.NewValues["Periodo"] = _PeriodoInfo.ClavePeriodo; }
private void importTimePlanning(object param) { OperationCompleteEventArgs operationCompleteEventArgs = new OperationCompleteEventArgs(false); ImportParam importParam = (ImportParam)param; try { SaveDataResult saveDataResult = _EmployeeTimeDao.ImportTime(importParam.List, importParam.ImportTimeType); operationCompleteEventArgs.Success = saveDataResult.Success; //[0,0]- min date //[0,1]- max date DateTime?[,] minmaxDate = (DateTime?[, ])saveDataResult.Data; // calculate holidays absence - need change Time field if (minmaxDate != null && minmaxDate[0, 0] != null && minmaxDate[0, 1] != null) { DateTime minDate = minmaxDate[0, 0].Value; DateTime maxDate = minmaxDate[0, 1].Value; if (Log.IsDebugEnabled) { Log.Debug(minDate.ToShortDateString() + " " + maxDate.ToShortDateString() + " - start recalculation"); } EmployeeBusinessObject.RecalculateHolidaysTimeRanges(minDate, maxDate); if (Log.IsDebugEnabled) { Log.Debug(minDate.ToShortDateString() + " " + maxDate.ToShortDateString() + " - finished recalculation"); } } //operationCompleteEventArgs.Param = saveDataResult.Data; } catch (Exception ex) { operationCompleteEventArgs.Param = ex; } OnOperationComplete(null, operationCompleteEventArgs); }
public void InsertAllIn(long emplid, DateTime date, bool bAllIn) { // align date to monday. Main rule: monday must be in future or Today => date >= Today if (date < DateTime.Today) { throw new ValidationException("ErrorChangingAllInInPast", null); } DateTime fromDate = date; if (fromDate.DayOfWeek != DayOfWeek.Monday) { fromDate = DateTimeHelper.GetMonday(fromDate); } if (fromDate < DateTime.Today) { fromDate = fromDate.AddDays(7); } Debug.Assert(fromDate.DayOfWeek == DayOfWeek.Monday); Employee empl = _employeeService.FindById(emplid); if (empl == null) { return; } Debug.WriteLine("Begin insert/update allin flag from - " + fromDate.ToShortDateString()); ListEmployeeAllIn manager = new ListEmployeeAllIn(emplid); if (manager.Insert(fromDate, bAllIn)) { EmployeeBusinessObject bzEmployee = new EmployeeBusinessObject(empl, fromDate); bzEmployee.UpdateAllInFlag(fromDate); } }
private void __RunCalculateEnactiveEmployee(object param) { long[] ids = (long[])param; EmployeeBusinessObject.RecalculateAfterModifiedContractEndDate(ids); }