public void SaveFamily() { login = new Login(); login.AcctType = "Family"; login.UserName = family.UserName; login.Password = family.Password; try { AdoptDatabase adoptDatabase = new AdoptDatabase(); int i = adoptDatabase.SaveFamily(family).Result; int l = adoptDatabase.SaveLogin(login).Result; if (i == 1 && l == 1) { ClearFamily(); lblInfo = "User Saved Successfully."; } else { lblInfo = "Cannot Save User"; } } catch (Exception ex) { lblInfo = ex.Message.ToString(); } }
public void SaveCaseWorker() { login = new Login(); login.AcctType = "Worker"; login.UserName = caseWorker.UserName; login.Password = caseWorker.Password; try { AdoptDatabase adoptDatabase = new AdoptDatabase(); int i = adoptDatabase.SaveCaseWorker(caseWorker).Result; int l = adoptDatabase.SaveLogin(login).Result; if (i == 1 && l == 1) { ClearCaseWorker(); lblInfo = "Caseworker Saved Successfully."; } else { lblInfo = "Cannot save Caseworker Information"; } } catch (Exception ex) { lblInfo = ex.Message.ToString(); } }