public MandatoryList GetMandatoryListWithStatusApproveAndChangeRequest() { List <MandatoryListChangeRequest> mandatoryListChangeRequests = new List <MandatoryListChangeRequest>(); MandatoryListChangeRequest changeRequest = new MandatoryListChangeRequest() { DivisionCode = "1010", DivisionNameAr = "Name Ar", DivisionNameEn = "Name En", Products = new List <MandatoryListProductChangeRequest>() { GetMandatoryListProductChangeRequest(), GetMandatoryListProductChangeRequest() } }; changeRequest.Add(); mandatoryListChangeRequests.Add(changeRequest); MandatoryList mandatoryList = new MandatoryList(); MandatoryListProduct product = GetMandatoryListProdcut(); mandatoryList.ChangeRequests = mandatoryListChangeRequests; mandatoryList.Products = new List <MandatoryListProduct>() { product, product }; mandatoryList.Add(); mandatoryList.SendToApproval(); mandatoryList.Approve(); return(mandatoryList); }
public async Task <MandatoryList> Add(MandatoryList entity) { var addedEntity = _dbContext.MandatoryLists.Add(entity); await _dbContext.SaveChangesAsync(); return(addedEntity.Entity); }
public MandatoryList GetMandatoryListWithOutProdcuts() { MandatoryList mandatoryList = new MandatoryList(); mandatoryList.Products = new List <MandatoryListProduct>(); mandatoryList.Add(); return(mandatoryList); }
public MandatoryList GetMandatoryListWithProdcuts() { MandatoryList mandatoryList = new MandatoryList(); MandatoryListProduct product = GetMandatoryListProdcut(); mandatoryList.Products = new List <MandatoryListProduct>() { product, product }; mandatoryList.Add(); return(mandatoryList); }
public MandatoryList GetMandatoryListWithStatusRejected() { MandatoryList mandatoryList = new MandatoryList(); MandatoryListProduct product = GetMandatoryListProdcut(); mandatoryList.Products = new List <MandatoryListProduct>() { product, product }; mandatoryList.Add(); mandatoryList.SendToApproval(); mandatoryList.Reject("Test"); return(mandatoryList); }
public MandatoryList GetMandatoryListWithStatusWaitingApprove() { MandatoryList mandatoryList = new MandatoryList(); MandatoryListProduct product = GetMandatoryListProdcut(); mandatoryList.Products = new List <MandatoryListProduct>() { product, product }; mandatoryList.Add(); mandatoryList.SendToApproval(); return(mandatoryList); }
private async Task AddChangeRequest(MandatoryList entity, MandatoryList dbEntity) { var changeRequest = _mapper.Map <MandatoryListChangeRequest>(entity); dbEntity.AddChangeRequest(changeRequest); await _mandatoryListCommands.Update(dbEntity); NotificationArguments NotificationArguments = new NotificationArguments { BodyEmailArgs = new object[] { "", entity.DivisionNameAr, entity.DivisionCode }, SubjectEmailArgs = new object[] { }, PanelArgs = new object[] { entity.DivisionNameAr, entity.DivisionCode }, SMSArgs = new object[] { entity.DivisionNameAr, entity.DivisionCode } }; MainNotificationTemplateModel mainNotificationTemplateModel = new MainNotificationTemplateModel(NotificationArguments, $"MandatoryList/Details?id={Util.Encrypt(entity.Id)}", NotificationEntityType.MandatoryList, entity.Id.ToString()); await _notificationAppService.SendNotificationForUsersByRoleName(NotificationOperations.MandatoryListApprover.MandatoryListProducts.SendUpdateMandatoryListToApprove, RoleNames.MandatoryListApprover, mainNotificationTemplateModel); }
public async Task Update(MandatoryList entity) { _dbContext.MandatoryLists.Update(entity); await _dbContext.SaveChangesAsync(); }