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>()); }
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); } }
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); } }
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); } }
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); } }
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); } }
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); } }
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); } }
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); } }
/// <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)); }
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); }
/// <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)); }