Exemple #1
0
 protected int AddServiceObj(Services serviceObj)
 {
     serviceObj.CreatedDate = DateTime.Now;
     serviceObj.LastModifiedDate = DateTime.Now;
     serviceObj.IsDeleted = false;
     int counts = 0;
     try
     {
         CDProDatabaseEntities MWDB = new CDProDatabaseEntities();
         MWDB.Services.AddObject(serviceObj);
         counts = MWDB.SaveChanges();
         if (counts > 0)
         {
             string userHostAddress = HttpContext.Current.Request.UserHostAddress;
             
             return 0;
         }
     }
     catch (Exception ex)
     {
         string userHostAddress = HttpContext.Current.Request.UserHostAddress;
         
         return -1;
     }
     return 1;
 }
 public virtual List <Services> GetChargeItem()
 {
     try
     {
         using (CDProDatabaseEntities objDB = new CDProDatabaseEntities())
         {
             List <Services> chargeItemList = objDB.Services.Where(it => it.Logo != null).ToList();
             if (chargeItemList.Count > 0)
             {
                 return(chargeItemList);
             }
         }
     }
     catch (Exception)
     {
         return(null);
     }
     return(null);
 }