예제 #1
0
        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;
            }
        }
예제 #2
0
        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);
        }
예제 #3
0
        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" }));
        }
예제 #5
0
 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" }));
        }
예제 #9
0
        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);
        }
예제 #10
0
        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" }));
        }
예제 #13
0
 public async Task <Vote> Create([FromBody] Vote vote)
 {
     try
     {
         UOW.BeginTransaction();
         return(await this.voteRepository.Insert(UOW, vote));
     }
     finally
     {
         UOW.SaveChanges();
         UOW.CloseTransaction();
     }
 }
예제 #14
0
 public bool RemoveCustomerLogin(CustomerLoginDTO removeEntity)
 {
     try
     {
         bool success = UOW.UserRepo.RemoveCustomerLogin(removeEntity);
         UOW.SaveChanges();
         return(success);
     }
     catch (Exception ex)
     {
         UOW.RollbackChanges();
         throw ex;
     }
 }
예제 #15
0
 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;
     }
 }
예제 #16
0
 public CountryDTO Update(CountryDTO newModel)
 {
     try
     {
         CountryDTO returnModel = UOW.CountryRepo.Update(newModel);
         UOW.SaveChanges();
         return(returnModel);
     }
     catch (Exception ex)
     {
         UOW.RollbackChanges();
         throw ex;
     }
 }
예제 #17
0
 public bool AddSupplierLogin(SupplierLoginDTO newEntity)
 {
     try
     {
         bool success = UOW.UserRepo.AddSupplierLogin(newEntity);
         UOW.SaveChanges();
         return(success);
     }
     catch (Exception ex)
     {
         UOW.RollbackChanges();
         throw ex;
     }
 }
예제 #18
0
 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;
     }
 }
예제 #19
0
 public RMADetailedDTO Create(CreateRMADTO entityToCreate)
 {
     try
     {
         int newRMAID = UOW.RMARepo.Create(entityToCreate);
         UOW.SaveChanges();
         return(GetByID(newRMAID));
     }
     catch (Exception ex)
     {
         UOW.RollbackChanges();
         throw ex;
     }
 }
예제 #20
0
 public bool Delete(int id)
 {
     try
     {
         bool success = UOW.ProductGroupRepo.Delete(id);
         UOW.SaveChanges();
         return(success);
     }
     catch (Exception ex)
     {
         UOW.RollbackChanges();
         throw ex;
     }
 }
예제 #21
0
 public CustomerDTO Update(CustomerDTO newModel)
 {
     try
     {
         var returnModel = UOW.CustomerRepo.Update(newModel);
         UOW.SaveChanges();
         return(returnModel);
     }
     catch (Exception ex)
     {
         UOW.RollbackChanges();
         throw ex;
     }
 }
예제 #22
0
 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;
     }
 }
예제 #23
0
 public ProductGroupDTO Update(ProductGroupDTO newModel)
 {
     try
     {
         ProductGroupDTO returnModel = UOW.ProductGroupRepo.Update(newModel);
         UOW.SaveChanges();
         return(returnModel);
     }
     catch (Exception ex)
     {
         UOW.RollbackChanges();
         throw ex;
     }
 }
예제 #24
0
 public ItemDTO Update(ItemDTO newModel)
 {
     try
     {
         ItemDTO returnModel = UOW.ItemRepo.Update(newModel);
         UOW.SaveChanges();
         return(returnModel);
     }
     catch (Exception ex)
     {
         UOW.RollbackChanges();
         throw ex;
     }
 }
예제 #25
0
 public bool RemoveItemFromRMA(int rmaItemID)
 {
     try
     {
         var result = UOW.RMARepo.RemoveItemFromRMA(rmaItemID);
         UOW.SaveChanges();
         return(result);
     }
     catch (Exception ex)
     {
         UOW.RollbackChanges();
         throw ex;
     }
 }
예제 #26
0
 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;
     }
 }
예제 #27
0
 public bool Delete(int rmaID)
 {
     try
     {
         bool result = UOW.RMARepo.Delete(rmaID);
         UOW.SaveChanges();
         return(result);
     }
     catch (Exception ex)
     {
         UOW.RollbackChanges();
         throw ex;
     }
 }
예제 #28
0
 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);
 }
예제 #29
0
 public RMAItemDTO UpdateRMAItem(UpdateRMAItemDTO updatedRecord)
 {
     try
     {
         var returnModel = UOW.RMARepo.UpdateRMAItem(updatedRecord);
         UOW.SaveChanges();
         return(returnModel);
     }
     catch (Exception ex)
     {
         UOW.RollbackChanges();
         throw ex;
     }
 }
예제 #30
0
 public BasicSiteConfigDTO UpdateSiteConfig(BasicSiteConfigDTO newPage)
 {
     try
     {
         var returnModel = UOW.ContentRepo.UpdateSiteConfig(newPage);
         UOW.SaveChanges();
         return(returnModel);
     }
     catch (Exception ex)
     {
         UOW.RollbackChanges();
         throw ex;
     }
 }