public bool deleteFirm(long firmId) { try { using (cfgContext db = new cfgContext()) { var firm = db.Firm.Find(firmId); if (firm != null) { var um = new UserManagement.UserFunctions(); um.dellEmail(firm.Mail); db.Firm.Remove(firm); db.SaveChanges(); return(true); } else { return(false); } } } catch (Exception) { return(false); } }
public long addFirm(Firm param) { try { using (cfgContext db = new cfgContext()) { var um = new UserManagement.UserFunctions(); um.addEmail(param.Mail); db.Firm.Add(param); db.SaveChanges(); return(param.FirmId); } } catch (Exception) { return(0); } }