public ProcResult AddEmail(MTEmail email) { ProcResult result = new ProcResult(); try { _context.MTEmails.Add(email); _context.SaveChanges(); result.ErrorID = 0; result.strResult = "Email Added Successfully"; } catch (Exception ex) { result.ErrorID = 1; result.strResult = ex.Message; } return(result); }
public ProcResult UpdateEmail(MTEmail email) { ProcResult result = new ProcResult(); try { var obj = _context.MTEmails.Find(email.EmaidID); obj.EmaidID = email.EmaidID; obj.Email = email.Email; obj.Password = email.Password; obj.UserID = email.UserID; _context.SaveChanges(); result.ErrorID = 0; result.strResult = "Email Updated Successfully"; } catch (Exception ex) { result.ErrorID = 1; result.strResult = ex.Message; } return(result); }