예제 #1
0
 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);
     }
 }
예제 #2
0
 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);
     }
 }