Beispiel #1
0
        public void UpdateDepartmentTypeDto(DepartmentTypeDto departmentTypeDto)
        {
            var departmentType = Mapper.Map <DepartmentType>(departmentTypeDto);

            departmentType.CreatedBy   = "Test";
            departmentType.CreatedDate = DateTime.Now;
            UpdateDepartmentType(departmentType);
        }
Beispiel #2
0
        public void CreateNewDepartmentTypeDto(DepartmentTypeDto departmentTypeDto)
        {
            var departmentType = Mapper.Map <DepartmentType>(departmentTypeDto);

            departmentType.EducationalCenterId = WebUserInfo.SiteId;

            departmentType.CreatedBy   = WebUserInfo.UserId.ToString();
            departmentType.CreatedDate = DateTime.Now;
            CreateNewDepartmentType(departmentType);
        }
 public ActionResult Update(DepartmentTypeDto model)
 {
     try
     {
         departmentTypeService.UpdateDepartmentTypeDto(model);
         var successMessage = $"دپارتمان {model.NameFa} با موفقیت ثبت شد";
         return(Json(new { success = true, message = successMessage }, JsonRequestBehavior.AllowGet));
     }
     catch (Exception ex)
     {
         var failMessage = "خطایی در ذخیره رخ داد، لطفا ورود داده را بررسی نمایید";
         failMessage += $".<br /> code {ex.Message}";
         return(Json(new { success = false, message = failMessage }, JsonRequestBehavior.AllowGet));
     }
 }