public MemberConditionsEditModel SaveNewMemberCondition (MemberConditionsEditModel model) { if (model.UserSelectedForConditionMembershipNo == 0) throw new AppException ("Please Select A Person"); var user = GetLoggedInUser (); var membermodel = _groupMembershipDal.GroupMembershipModelByGroupMembershipId (model.UserSelectedForConditionMembershipNo); if (membermodel == null) throw new AppException ("Please Select A Valid Person"); //var selectedperson = _customUserDal.CustomUserByAccountNumber(membermodel.AccountNumberString); model.UserSelectedForConditionAcctNo = membermodel.AccountNumberString; var condition = new MemberConditions (); condition.Update (model); condition.InsertedBy = user.AccountNumberString; var saved = _memberConditionsDal.Save (condition); //pass the user who is receiving the condition //get the user from the selected person //save the type of condition return model; }
public MemberConditions Delete(MemberConditions m) { var result = new MemberConditions(); result.Update(m); _appDbContext.Remove(result); _appDbContext.SaveChanges(); return(result); }
public MemberConditionsEditModel DeleteMemberCondition (MemberConditionsEditModel model) { //var condition = _memberConditionsDal.MemberConditionByConditionId(model.ConditionId); var condition = new MemberConditions (); condition.Update (model); var deleted = _memberConditionsDal.Delete (condition); var result = new MemberConditionsEditModel (); result.Update (deleted); return result; }
public MemberConditions Save(MemberConditions m) { if (m.ConditionId >= 1) { _appDbContext.Update(m); _appDbContext.Add(m); _appDbContext.SaveChanges(); return(m); } var result = new MemberConditions(); result.Update(m); _appDbContext.Add(result); _appDbContext.SaveChanges(); return(result); }