Пример #1
0
 public static List<CostCenter> GetAllCmbCostCenter()
 {
     List<CostCenter> result = new List<CostCenter>();
     NewAppsCnn newAppsCnn = new NewAppsCnn(AppSettings.CrAppSettings.NewAppsConnectionString);
     var dbCostCenters = from g in newAppsCnn.Acc_CostCenter where g.IsDisable==false select g;
     foreach (var dbCostCenter in dbCostCenters)
     {
         CostCenter account = new CostCenter();
         account.FromDbCostCenter(dbCostCenter);
         result.Add(account);
     }
     return result;
 }
Пример #2
0
 public static CostCenter FindByCostCenterId(int? _VaidationID)
 {
     NewAppsCnn newAppsCnn = new NewAppsCnn(AppSettings.CrAppSettings.NewAppsConnectionString);
     var dbCostCenters = from u in newAppsCnn.Acc_CostCenter where u.CostCenterId == _VaidationID select u;
     if (dbCostCenters.Count() > 0)
     {
         Acc_CostCenter dbCostCenter = dbCostCenters.First();
         CostCenter account = new CostCenter();
         account.FromDbCostCenter(dbCostCenter);
         account.IsNew = false;
         account.IsCopy = false;
         return account;
     }
     else
         return null;
 }