Exemple #1
0
        public async Task <IHttpActionResult> Save(EmployeeDto model)
        {
            Employee_Input inputparams = new Employee_Input()
            {
                Id           = model.Id,
                FirstName    = model.FirstName,
                LastName     = model.LastName,
                Email        = model.Email,
                Address      = model.Address,
                DepartmentId = model.DepartmentId
            };

            if (model.Id == 0)
            {
                _employeeService.CreateEmployee(inputparams);
            }
            else
            {
                _employeeService.UpdateEmployee(inputparams);
            }

            return(Ok(model));
        }
        public void UpdateEmployee(Employee_Input employeeInput)
        {
            var db = new StoredProcContext();

            db.EmployeeUpdate.CallStoredProc(employeeInput);
        }