Пример #1
0
 public Ld_Institution_Company GetCompanyPro(int systemId, string companyId)
 {
     try
     {
         if (systemId == 0)
         {
             throw new Exception("系统编号不能为0!");
         }
         if (string.IsNullOrWhiteSpace(companyId))
         {
             throw new Exception("公司编号不能为空!");
         }
         int    errCode = -1;
         string errMsg  = "fail";
         var    result  = LdCmsDbEntitiesContext.SP_Get_Institution_Company(systemId, companyId, out errCode, out errMsg);
         if (errCode != 0)
         {
             throw new Exception(errMsg);
         }
         if (result == null)
         {
             return(null);
         }
         else
         {
             return(result.ToObject <List <Ld_Institution_Company> >().FirstOrDefault());
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }