Ejemplo n.º 1
0
        public List <object> GetByChildProductCategoryIdPagingVisible(string languageId, int pageNumber, int pageSize, Guid productCategoryId, out OperationResult operationResult)
        {
            var ce = DBMapManager.CreateInstance();

            operationResult = new OperationResult {
                Type = OperationResult.ResultType.Success
            };
            return(ce.ProductInfo_GetByProductCategoryId_Child_Paging_Visible(languageId, pageSize, pageNumber,
                                                                              productCategoryId).ToList <object>());
        }
Ejemplo n.º 2
0
 public List <object> GetPagingOrderByName(string languageId, int pageNumber, int pageSize, out OperationResult operationResult)
 {
     try
     {
         var entities = DBMapManager.CreateInstance();
         operationResult = new OperationResult {
             Type = OperationResult.ResultType.Success
         };
         return((from obj in entities.NewsStatus
                 select obj).OrderBy(obj => obj.Name).Skip(pageSize * (pageNumber - 1)).Take(pageSize).ToList <object>());
     }
     catch (Exception)
     {
         operationResult = new OperationResult {
             Type = OperationResult.ResultType.Warning
         };
         return(null);
     }
 }
Ejemplo n.º 3
0
 public int CountAll(out OperationResult operationResult)
 {
     try
     {
         var entities = DBMapManager.CreateInstance();
         operationResult = new OperationResult {
             Type = OperationResult.ResultType.Success
         };
         return((from obj in entities.EmailReceiver
                 select obj).Count());
     }
     catch (Exception ex)
     {
         operationResult = new OperationResult {
             Type = OperationResult.ResultType.Failure, Message = ex.StackTrace
         };
         return(0);
     }
 }
Ejemplo n.º 4
0
 public int CountAll(string languageId, out OperationResult operationResult)
 {
     try
     {
         var entities = DBMapManager.CreateInstance();
         operationResult = new OperationResult {
             Type = OperationResult.ResultType.Success
         };
         return((from obj in entities.SpecialImage
                 where obj.LanguageId == languageId
                 select obj).Count());
     }
     catch (Exception ex)
     {
         operationResult = new OperationResult {
             Type = OperationResult.ResultType.Failure, Message = ex.StackTrace
         };
         return(0);
     }
 }
Ejemplo n.º 5
0
 public int CountAllByProductCategoryIdVisible(string languageId, Guid productCategoryId, out OperationResult operationResult)
 {
     try
     {
         var entities = DBMapManager.CreateInstance();
         operationResult = new OperationResult {
             Type = OperationResult.ResultType.Success
         };
         return((from obj in entities.ProductInfo
                 where obj.LanguageId == languageId && obj.ProductCategoryId == productCategoryId && obj.Visible == true
                 select obj).Count());
     }
     catch (Exception ex)
     {
         operationResult = new OperationResult {
             Type = OperationResult.ResultType.Failure, Message = ex.StackTrace
         };
         return(0);
     }
 }
Ejemplo n.º 6
0
 public List <object> GetPagingOrderByOrderVisible(string languageId, int pageNumber, int pageSize, out OperationResult operationResult)
 {
     try
     {
         var entities = DBMapManager.CreateInstance();
         operationResult = new OperationResult {
             Type = OperationResult.ResultType.Success
         };
         return((from obj in entities.ProductInfo
                 where obj.LanguageId == languageId && obj.Visible == true
                 select obj).OrderBy(obj => obj.Order).Skip(pageSize * (pageNumber - 1)).Take(pageSize).ToList <object>());
     }
     catch (Exception)
     {
         operationResult = new OperationResult {
             Type = OperationResult.ResultType.Warning
         };
         return(null);
     }
 }
Ejemplo n.º 7
0
 public List <object> GetByProviderPagingOrderByName(string languageId, Guid rssProviderId, int pageNumber, int pageSize, out OperationResult operationResult)
 {
     try
     {
         var entities = DBMapManager.CreateInstance();
         operationResult = new OperationResult {
             Type = OperationResult.ResultType.Success
         };
         return((from obj in entities.RssSource
                 where obj.LanguageId == languageId && obj.RssProviderId == rssProviderId
                 select obj).OrderBy(obj => obj.Name).Skip(pageSize * (pageNumber - 1)).Take(pageSize).ToList <object>());
     }
     catch (Exception)
     {
         operationResult = new OperationResult {
             Type = OperationResult.ResultType.Warning
         };
         return(null);
     }
 }
Ejemplo n.º 8
0
 public int CountByRoot(string languageId, out OperationResult operationResult)
 {
     try
     {
         var entities = DBMapManager.CreateInstance();
         operationResult = new OperationResult {
             Type = OperationResult.ResultType.Success
         };
         return((from obj in entities.NewsCategory
                 where obj.LanguageId == languageId && (obj.ParrentId == Guid.Empty || !obj.ParrentId.HasValue)
                 select obj).Count());
     }
     catch (Exception ex)
     {
         operationResult = new OperationResult {
             Type = OperationResult.ResultType.Failure, Message = ex.StackTrace
         };
         return(0);
     }
 }
Ejemplo n.º 9
0
 public List <object> GetRootPagingOrderByName(string languageId, int pageNumber, int pageSize, out OperationResult operationResult)
 {
     try
     {
         var entities = DBMapManager.CreateInstance();
         operationResult = new OperationResult {
             Type = OperationResult.ResultType.Success
         };
         return((from obj in entities.NewsCategory
                 where obj.LanguageId == languageId && (obj.ParrentId == Guid.Empty || !obj.ParrentId.HasValue)
                 select obj).OrderBy(obj => obj.Name).Skip(pageSize * (pageNumber - 1)).Take(pageSize).ToList <object>());
     }
     catch (Exception)
     {
         operationResult = new OperationResult {
             Type = OperationResult.ResultType.Warning
         };
         return(null);
     }
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Select first or default data with filter
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="filter"></param>
 /// <returns></returns>
 public T SelectFirstOrDefault <T>(Expression <Func <T, bool> > filter, out OperationResult operationResult)
     where T : class, new()
 {
     return(Artnman.Core.Service.Common.Instance.SelectFirstOrDefault <T>(DBMapManager.CreateInstance(), filter,
                                                                          out operationResult));
 }
Ejemplo n.º 11
0
 public void Insert <T>(T entity, out OperationResult operationResult) where T : class, new()
 {
     Artnman.Core.Service.Common.Instance.Insert <T>(DBMapManager.CreateInstance(), entity, out operationResult);
 }
Ejemplo n.º 12
0
 /// <summary>
 /// Update database with entity and filter
 /// Ex: Update(obj, ob=>ob.objId == id)
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="entity"></param>
 /// <param name="filter"></param>
 /// <returns></returns>
 public Boolean Update <T>(T entity, Expression <Func <T, bool> > filter, out OperationResult operationResult)
     where T : class, new()
 {
     return(Artnman.Core.Service.Common.Instance.Update <T>(DBMapManager.CreateInstance(), entity, filter,
                                                            out operationResult));
 }