예제 #1
0
        public void QuickUpdateEmployee(EmployeeQuickUpdateModel model)
        {
            Guid employeeId = model.id;
            var  _201       = this._repoEmployee201.Query().Filter(x => x.mf_Employees.Any(e => e.id == employeeId)).Get().FirstOrDefault();

            if (_201 != null)
            {
                var userId = this.GetCurrentUserId();
                _201.employeeCode       = model.employeeCode;
                _201.positionId         = model.position == null ? (Guid?)null : model.position.value;
                _201.departmentId       = model.department == null ? (Guid?)null : model.department.value;
                _201.employmentStatusId = model.employmentStatus == null ? (Guid?)null : model.employmentStatus.value;
                _201.employmentTypeId   = model.employmentType == null ? (Guid?)null : model.employmentType.value;
                _201.positionLevel      = model.positionLevel == null ? (int?)null : model.positionLevel.value;
                _201.updatedBy          = userId;
                _201.updatedDate        = DateTime.Now;
                this._repoEmployee201.Update(_201);
                this._unitOfWork.Save();
            }
        }
예제 #2
0
        public ActionResult QuickUpdateEmployee([DataSourceRequest] DataSourceRequest request, EmployeeQuickUpdateModel model)
        {
            if (model != null && ModelState.IsValid)
            {
                try
                {
                    this._employeeService.QuickUpdateEmployee(model);
                }
                catch (Exception ex)
                {
                    this.AddModelError(ex);
                }
            }

            return(Json(new[] { model }.ToDataSourceResult(request, ModelState)));
        }