public bool BagimsizBolumBlokKaydet(bagimsiz_bolumler model) { try { int sayac = Convert.ToInt32(model.daire_numarasi); for (int i = 1; i < sayac + 1; i++) { model.daire_numarasi = i.ToString(); _bagimsizBolumlerRepository.Insert(model); _uow.SaveChanges(); } if (sayac != 0) { return(true); } else { return(false); } } catch (Exception ex) { throw ex; } }
public EmployeeSalaryDTO newSalary(EmployeeSalaryDTO employeeSalary) { var added = MapperFactory.CurrentMapper.Map <EmployeeSalary>(employeeSalary); added = uow.GetRepository <EmployeeSalary>().Add(added); uow.SaveChanges(); return(MapperFactory.CurrentMapper.Map <EmployeeSalaryDTO>(added)); }
public EmployeeDetailDTO newEmployeeDetail(EmployeeDetailDTO employeeDetail) { var added = MapperFactory.CurrentMapper.Map <EmployeeDetail>(employeeDetail); added = uow.GetRepository <EmployeeDetail>().Add(added); uow.SaveChanges(); return(MapperFactory.CurrentMapper.Map <EmployeeDetailDTO>(added)); }
public void Delete(string id) { var entity = productRepository.Get(id); if (entity != null) { productRepository.Delete(entity); unitofWork.SaveChanges(); } }
public IActionResult Create(EmployeeViewModel employee) { if (ModelState.IsValid) { _unitofWork.EmployeeRepository.Create(_mapper.Map <Employee>(employee)); _unitofWork.SaveChanges(); return(RedirectToAction("Index")); } return(View()); }
public FieldDTO add(FieldDTO entity) { if (entity.FormId > 0 && !string.IsNullOrEmpty(entity.Name) && !string.IsNullOrEmpty(entity.DataType)) { Field field = Mapper.Map <Field>(entity); uow.GetRepository <Field>().Add(field); uow.SaveChanges(); return(Mapper.Map <FieldDTO>(field)); } return(null); }
public ActionResult Delete(EIdDTO model) { if (_postService.AnyPostByCategoryId(model.Id) == false) { _categoryService.Delete(model.Id); _uow.SaveChanges(); return(Json(true, JsonRequestBehavior.AllowGet)); } else { return(Json(false, JsonRequestBehavior.AllowGet)); } }
public bool deleteContractType(int contractTypeId) { try { var getContractType = uow.GetRepository <ContractType>().Get(z => z.Id == contractTypeId); uow.GetRepository <ContractType>().Delete(getContractType); uow.SaveChanges(); return(true); } catch (Exception) { return(false); } }
public bool deleteEmploymentType(int employmentTypeId) { try { var getEmploymentType = uow.GetRepository <EmploymentType>().Get(z => z.Id == employmentTypeId); uow.GetRepository <EmploymentType>().Delete(getEmploymentType); uow.SaveChanges(); return(true); } catch (Exception) { return(false); } }
public bool deleteMaritalStatusDTO(int MaritalStatusId) { try { var getMaritalStatus = uow.GetRepository <MaritalStatus>().Get(z => z.Id == MaritalStatusId); uow.GetRepository <MaritalStatus>().Delete(getMaritalStatus); uow.SaveChanges(); return(true); } catch (Exception) { return(false); } }
public bool deleteSystemEducation(int systemEducationId) { try { var getSystemEducation = uow.GetRepository <SystemEducation>().Get(z => z.Id == systemEducationId); uow.GetRepository <SystemEducation>().Delete(getSystemEducation); uow.SaveChanges(); return(true); } catch (Exception) { return(false); } }
public bool deleteExpense(int ExpenseId) { try { var getExpense = uow.GetRepository <Expense>().Get(z => z.Id == ExpenseId); uow.GetRepository <Expense>().Delete(getExpense); uow.SaveChanges(); return(true); } catch (Exception) { return(false); } }
public bool deletePermit(int PermitId) { try { var getPermit = uow.GetRepository <EmployeePermit>().Get(z => z.Id == PermitId); uow.GetRepository <EmployeePermit>().Delete(getPermit); uow.SaveChanges(); return(true); } catch (Exception) { return(false); } }
public bool deleteEmployeeOtherInfo(int employeeOtherInfoId) { try { var getEmployeeOtherInfo = uow.GetRepository <EmployeeOtherInfo>().Get(z => z.Id == employeeOtherInfoId); uow.GetRepository <EmployeeOtherInfo>().Delete(getEmployeeOtherInfo); uow.SaveChanges(); return(true); } catch (Exception) { return(false); } }
public bool deleteEmployeeSalary(int employeeSalaryId) { try { var getEmployeeSalary = uow.GetRepository <EmployeeSalary>().Get(z => z.Id == employeeSalaryId); uow.GetRepository <EmployeeSalary>().Delete(getEmployeeSalary); uow.SaveChanges(); return(true); } catch (Exception) { return(false); } }
public bool deleteRole(int roleId) { try { var getRole = uow.GetRepository <Role>().Get(z => z.Id == roleId); uow.GetRepository <Role>().Delete(getRole); uow.SaveChanges(); return(true); } catch (Exception) { return(false); } }
public bool deletePermitType(int permitTypeId) { try { var getPermitType = uow.GetRepository <PermitType>().Get(z => z.Id == permitTypeId); uow.GetRepository <PermitType>().Delete(getPermitType); uow.SaveChanges(); return(true); } catch (Exception) { return(false); } }
public bool deleteRequestForVisa(int RequestForVisaId) { try { var getRequestForVisa = uow.GetRepository <RequestForVisa>().Get(z => z.Id == RequestForVisaId); uow.GetRepository <RequestForVisa>().Delete(getRequestForVisa); uow.SaveChanges(); return(true); } catch (Exception) { return(false); } }
public bool deleteEducationLevel(int educationLevelId) { try { var getEducationLevel = uow.GetRepository <EducationLevel>().Get(z => z.Id == educationLevelId); uow.GetRepository <EducationLevel>().Delete(getEducationLevel); uow.SaveChanges(); return(true); } catch (Exception) { return(false); } }
public int Insert(UyeDTO uye) { try { var liste = AutoMapper.Mapper.DynamicMap <Uye>(uye); _uyeRepo.Insert(liste); _uow.SaveChanges(); return(liste.UyeID); } catch (Exception ex) { throw new Exception(ex.Message); } }
public ActionResult Create(District district) { try { // TODO: Add insert logic here _districtRepo.Add(district); UnitOfWork.SaveChanges(); return(RedirectToAction("Index")); } catch { return(View()); } }
public bool deleteDebitCategory(int debitCategoryId) { try { var getDebitCategory = uow.GetRepository <DebitCategory>().Get(z => z.Id == debitCategoryId); uow.GetRepository <DebitCategory>().Delete(getDebitCategory); uow.SaveChanges(); return(true); } catch (Exception) { return(false); } }
public bool deleteGender(int genderId) { try { var getGender = uow.GetRepository <Gender>().Get(z => z.Id == genderId); uow.GetRepository <Gender>().Delete(getGender); uow.SaveChanges(); return(true); } catch (Exception) { return(false); } }
public bool deleteTag(int tagId) { try { var delete = uow.GetRepository <Tag>().Get(z => z.Id == tagId); uow.GetRepository <Tag>().Delete(delete); uow.SaveChanges(); return(true); } catch (System.Exception) { return(false); } }
public bool deleteContact(int contactId) { try { var delete = uow.GetRepository <Contact>().Get(z => z.Id == contactId); uow.GetRepository <Contact>().Delete(delete); uow.SaveChanges(); return(true); } catch (System.Exception) { return(false); } }
public bool deleteDisabilitySituationDTO(int DisabilitySituationId) { try { var getDisablitySituation = uow.GetRepository <DisabilitySituation>().Get(z => z.Id == DisabilitySituationId); uow.GetRepository <DisabilitySituation>().Delete(getDisablitySituation); uow.SaveChanges(); return(true); } catch (Exception) { return(false); } }
public bool deleteCompanyBranch(int CompanyBranchId) { try { var getCompanyBranch = uow.GetRepository <CompanyBranch>().Get(z => z.Id == CompanyBranchId); uow.GetRepository <CompanyBranch>().Delete(getCompanyBranch); uow.SaveChanges(); return(true); } catch (Exception) { return(false); } }
public bool deleteDepartmant(int DepartmantId) { try { var getDepartment = uow.GetRepository <CompanyDepartment>().Get(z => z.Id == DepartmantId); uow.GetRepository <CompanyDepartment>().Delete(getDepartment); uow.SaveChanges(); return(true); } catch (Exception) { return(false); } }
public bool deleteBloodGroupDTO(int BloodGroupId) { try { var getBloodGroup = uow.GetRepository <BloodGroup>().Get(z => z.Id == BloodGroupId); uow.GetRepository <BloodGroup>().Delete(getBloodGroup); uow.SaveChanges(); return(true); } catch (Exception) { return(false); } }
public ActionResult Create(Client client) { try { // TODO: Add insert logic here _iClientRepository.Add(client); _unitOfWork.SaveChanges(); return(RedirectToAction("Index")); } catch { return(View()); } }