public UserProfileDTO Update(UserProfileDTO newModel, string key, string IV) { try { var currentModel = GetByID(newModel.UserID); if (!string.IsNullOrEmpty(newModel.Password) && !string.IsNullOrWhiteSpace(newModel.Password)) { newModel.EncryptedPassword = CryptoService.Encrypt(newModel.Password, key, IV); } else { newModel.EncryptedPassword = currentModel.EncryptedPassword; } if (newModel.UserRoleTypeID != currentModel.UserRoleTypeID) { SetupUserClaims(newModel.UserID, newModel.UserRoleTypeID); } var returnModel = UOW.UserRepo.Update(newModel); UOW.SaveChanges(); return(returnModel); } catch (Exception ex) { UOW.RollbackChanges(); throw ex; } }
public string Edit(EventData objEventData) { string msg; try { if (ModelState.IsValid) { using (UOW uow = new UOW()) { uow._iEventsDataRepository.Update(objEventData); uow.SaveChanges(); } msg = "Saved Successfully"; } else { msg = "Validation data not successfull"; } } catch (Exception ex) { msg = "Error occured:" + ex.Message; } return(msg); }
public ActionResult Create(EventData EventData) { string msg; try { //if (ModelState.IsValid) //{ using (UOW uow = new UOW()) { uow._iEventsDataRepository.Add(EventData); uow.SaveChanges(); } msg = "Saved Successfully"; //} //else //{ msg = "Validation data not successfull"; //} } catch (Exception ex) { msg = "Error occured:" + ex.Message; } return(View()); }
public ActionResult Resend(Guid id) { DailyLeaveManager dlm = new DailyLeaveManager(UOW); var dailyLeave = dlm.GetByID(id); dlm.Resend(dailyLeave); UOW.SaveChanges(); return(RedirectToAction("ShowDenied", new { ac = "Resend" })); }
public string Delete(int Id) { using (UOW uow = new UOW()) { uow._iEventsDataRepository.DeleteFindByID(Id); uow.SaveChanges(); } return("Deleted successfully"); }
public ActionResult DenyConfirmed(Guid id) { HourlyMissionManager dlm = new HourlyMissionManager(UOW); var result = dlm.GetByID(id); dlm.Deny(result); UOW.SaveChanges(); return(RedirectToAction("ApproveIndex", new { ac = "Deny" })); }
public ActionResult Resend(Guid id) { HourlyMissionManager dlm = new HourlyMissionManager(UOW); var HourlyMission = dlm.GetByID(id); dlm.Resend(HourlyMission); UOW.SaveChanges(); return(RedirectToAction("ShowDenied", new { ac = "Resend" })); }
public ActionResult ApproveConfirmed(Guid id) { DailyLeaveManager dlm = new DailyLeaveManager(UOW); var result = dlm.GetByID(id); dlm.Approve(result); UOW.SaveChanges(); return(RedirectToAction("ApproveIndex", new { ac = "Approve" })); }
public bool VerifyAccessKey(string exchangeKey) { bool success = UOW.SecurityRepo.VerifyAccessKey(exchangeKey); if (success) { UOW.SaveChanges(); } //Save required due to deleting the access key on verification for security purposes. return(success); }
public string AttemptUserAuthenticationAndGetAccessKey(AttemptLoginDTO inputDTO, string key, string IV) { string encryptedPassword = CryptoService.Encrypt(inputDTO.UserInputPasswordPlainText, key, IV); string returnAccessKey = UOW.SecurityRepo.AuthenticateUserAndGetExchangeKey(inputDTO, encryptedPassword); if (!string.IsNullOrEmpty(returnAccessKey)) { UOW.SaveChanges(); } return(returnAccessKey); }
public ActionResult ApproveAll() { HourlyMissionManager dlm = new HourlyMissionManager(UOW); var hourlyMissions = dlm.GetByOrganisationID(this.CurrentUser.OrganizationUnitID). Where(x => x.WorkflowStage.Order == 3); foreach (var Mission in hourlyMissions) { dlm.Approve(Mission); } UOW.SaveChanges(); return(RedirectToAction("ApproveIndex", new { ac = "ApproveAll" })); }
public ActionResult ApproveAll() { DailyLeaveManager dlm = new DailyLeaveManager(UOW); var dailyLeaves = dlm.GetByOrganisationID(this.CurrentUser.OrganizationUnitID). Where(x => x.WorkflowStage.Order == 3); foreach (var leave in dailyLeaves) { dlm.Approve(leave); } UOW.SaveChanges(); return(RedirectToAction("ApproveIndex", new { ac = "ApproveAll" })); }
public async Task <Vote> Create([FromBody] Vote vote) { try { UOW.BeginTransaction(); return(await this.voteRepository.Insert(UOW, vote)); } finally { UOW.SaveChanges(); UOW.CloseTransaction(); } }
public bool RemoveCustomerLogin(CustomerLoginDTO removeEntity) { try { bool success = UOW.UserRepo.RemoveCustomerLogin(removeEntity); UOW.SaveChanges(); return(success); } catch (Exception ex) { UOW.RollbackChanges(); throw ex; } }
public IEnumerable <CreditNoteItemDTO> CreditRMA(int rmaID) { try { int newCreditNoteID = UOW.CreditNoteRepo.CreditRMA(rmaID); UOW.SaveChanges(); return(UOW.CreditNoteRepo.GetByID(newCreditNoteID)); } catch (Exception ex) { UOW.RollbackChanges(); throw ex; } }
public CountryDTO Update(CountryDTO newModel) { try { CountryDTO returnModel = UOW.CountryRepo.Update(newModel); UOW.SaveChanges(); return(returnModel); } catch (Exception ex) { UOW.RollbackChanges(); throw ex; } }
public bool AddSupplierLogin(SupplierLoginDTO newEntity) { try { bool success = UOW.UserRepo.AddSupplierLogin(newEntity); UOW.SaveChanges(); return(success); } catch (Exception ex) { UOW.RollbackChanges(); throw ex; } }
public RMAItemDTO AddItemToRMA(CreateRMAItemDTO entityToCreate) { try { var rmaItemID = UOW.RMARepo.AddItemToRMA(entityToCreate); UOW.SaveChanges(); return(UOW.RMARepo.GetRMAItemByID(rmaItemID)); } catch (Exception ex) { UOW.RollbackChanges(); throw ex; } }
public RMADetailedDTO Create(CreateRMADTO entityToCreate) { try { int newRMAID = UOW.RMARepo.Create(entityToCreate); UOW.SaveChanges(); return(GetByID(newRMAID)); } catch (Exception ex) { UOW.RollbackChanges(); throw ex; } }
public bool Delete(int id) { try { bool success = UOW.ProductGroupRepo.Delete(id); UOW.SaveChanges(); return(success); } catch (Exception ex) { UOW.RollbackChanges(); throw ex; } }
public CustomerDTO Update(CustomerDTO newModel) { try { var returnModel = UOW.CustomerRepo.Update(newModel); UOW.SaveChanges(); return(returnModel); } catch (Exception ex) { UOW.RollbackChanges(); throw ex; } }
public IEnumerable <ReturnNoteItemDTO> ProcessReturn(int rmaID) { try { int newReturnNoteID = UOW.ReturnNoteRepo.ProcessReturn(rmaID); UOW.SaveChanges(); return(UOW.ReturnNoteRepo.GetByID(newReturnNoteID)); } catch (Exception ex) { UOW.RollbackChanges(); throw ex; } }
public ProductGroupDTO Update(ProductGroupDTO newModel) { try { ProductGroupDTO returnModel = UOW.ProductGroupRepo.Update(newModel); UOW.SaveChanges(); return(returnModel); } catch (Exception ex) { UOW.RollbackChanges(); throw ex; } }
public ItemDTO Update(ItemDTO newModel) { try { ItemDTO returnModel = UOW.ItemRepo.Update(newModel); UOW.SaveChanges(); return(returnModel); } catch (Exception ex) { UOW.RollbackChanges(); throw ex; } }
public bool RemoveItemFromRMA(int rmaItemID) { try { var result = UOW.RMARepo.RemoveItemFromRMA(rmaItemID); UOW.SaveChanges(); return(result); } catch (Exception ex) { UOW.RollbackChanges(); throw ex; } }
public bool UpdateImage(int id, string imageName) { try { bool success = UOW.ItemRepo.UpdateImageNane(id, imageName); UOW.SaveChanges(); return(success); } catch (Exception ex) { UOW.RollbackChanges(); throw ex; } }
public bool Delete(int rmaID) { try { bool result = UOW.RMARepo.Delete(rmaID); UOW.SaveChanges(); return(result); } catch (Exception ex) { UOW.RollbackChanges(); throw ex; } }
public async Task <int> InsertElection([FromBody] List <Vote> electionObj) { try { UOW.BeginTransaction(); var result = await this.voteRepository.InsertElection(UOW, electionObj); } finally { UOW.SaveChanges(); UOW.CloseTransaction(); } return(0); }
public RMAItemDTO UpdateRMAItem(UpdateRMAItemDTO updatedRecord) { try { var returnModel = UOW.RMARepo.UpdateRMAItem(updatedRecord); UOW.SaveChanges(); return(returnModel); } catch (Exception ex) { UOW.RollbackChanges(); throw ex; } }
public BasicSiteConfigDTO UpdateSiteConfig(BasicSiteConfigDTO newPage) { try { var returnModel = UOW.ContentRepo.UpdateSiteConfig(newPage); UOW.SaveChanges(); return(returnModel); } catch (Exception ex) { UOW.RollbackChanges(); throw ex; } }