public List<object> GetAllOrderByName(string languageId, out OperationResult operationResult) { return Common.Instance.SelectList<NewsStatus> (null, out operationResult) .OrderBy(obj => obj.Name) .ToList<object>(); }
public List<object> GetAll(string languageId, out OperationResult operationResult) { return Common.Instance.SelectList<RssSource> (obj => obj.LanguageId == languageId, out operationResult) .OrderBy(obj => obj.CreateDate) .ToList<object>(); }
public List<object> GetAllOrderByName(string languageId, out OperationResult operationResult) { return Common.Instance.SelectList<RssProvider> (obj => obj.LanguageId == languageId, out operationResult) .OrderBy(obj => obj.Name) .ToList<object>(); }
public void Delete(Guid id, out OperationResult operationResult) { lock (Lock) { Common.Instance.Delete<EmailReceiver> (obj => obj.EmailReceiverId == id, out operationResult); } }
public void Delete(Guid id, out OperationResult operationResult) { lock (Lock) { Common.Instance.Delete<Registration> (obj => obj.RegistrationId == id, out operationResult); } }
public void Delete(string languageId, Guid id, out OperationResult operationResult) { lock (Lock) { Common.Instance.Delete<SpecialImageType> (obj => obj.SpecialImageTypeId == id && obj.LanguageId == languageId, out operationResult); } }
public void Delete(string languageId, Guid id, out OperationResult operationResult) { lock (Lock) { Common.Instance.Delete<VideoAlbum> (obj => obj.VideoAlbumId == id && obj.LanguageId == languageId, out operationResult); } }
public void Delete(string languageId, Guid id, out OperationResult operationResult) { lock (Lock) { Common.Instance.Delete<RssProvider> (obj => obj.RssProviderId == id && obj.LanguageId == languageId, out operationResult); } }
public void Delete(string languageId, Guid id, out OperationResult operationResult) { lock (Lock) { Common.Instance.Delete<NewsComment> (obj => obj.NewsCommentId == id && obj.LanguageId == languageId, out operationResult); } }
public List<object> GetAll(out OperationResult operationResult) { var list = new List<object> { new LanguageEntity {LanguageId = "vi-VN", Name = "Tiếng Việt"}, new LanguageEntity {LanguageId = "en-US", Name = "English"} }; operationResult = new OperationResult { Type = OperationResult.ResultType.Success }; return list; }
public static int GetIntValue(string key, out OperationResult operationResult) { int outValue; if (!int.TryParse(ConfigurationManager.AppSettings[key], out outValue)) { operationResult = new OperationResult { Type = OperationResult.ResultType.Failure }; return -1; } operationResult = new OperationResult { Type = OperationResult.ResultType.Success }; return outValue; }
public static bool GetBoolValue(string key, out OperationResult operationResult) { bool outValue; if (!bool.TryParse(ConfigurationManager.AppSettings[key], out outValue)) { operationResult = new OperationResult { Type = OperationResult.ResultType.Failure }; return false; } operationResult = new OperationResult { Type = OperationResult.ResultType.Success }; return outValue; }
public List<object> GetAll(string languageId, out OperationResult operationResult) { try { return Common.Instance.SelectList<Support> (obj => obj.LanguageId == languageId, out operationResult) .ToList<object>(); } catch (Exception ex) { operationResult = new OperationResult { Type = OperationResult.ResultType.Warning, Message = ex.Message + ex.StackTrace }; return null; } }
/// <summary> /// For the simplicity of the development process, just use a simple function and /// error display method. /// Config a special message type for Success case in the Page. (ADD/EDIT/DELETE ...) /// </summary> /// <param name="opResult"></param> /// <returns></returns> /// TODO: For method with special error return, use the switch case structure instead public bool ValidateOperation(OperationResult opResult) { switch (opResult.Type) { case OperationResult.ResultType.Success: return true; case OperationResult.ResultType.Failure: ShowAlert(AlertType.Error, MessageConstant.Error, MessageConstant.InternalError + "<br />" + opResult.Message); return false; default: ShowAlert(AlertType.Error, MessageConstant.Error, MessageConstant.InvalidCredential + "<br />" + opResult.Message); return false; } }
public int CountAll(out OperationResult operationResult) { try { var entities = DBMapManager.CreateInstance(); operationResult = new OperationResult { Type = OperationResult.ResultType.Success }; return (from obj in entities.Registration select obj).Count(); } catch (Exception ex) { operationResult = new OperationResult { Type = OperationResult.ResultType.Failure, Message = ex.StackTrace }; return 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; } }
public int CountByParentId(string languageId, Guid parentId, out OperationResult operationResult) { try { var entities = DBMapManager.CreateInstance(); operationResult = new OperationResult { Type = OperationResult.ResultType.Success }; return (from obj in entities.ProductCategory where obj.LanguageId == languageId && obj.ParrentId == parentId 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.VideoAlbum where obj.LanguageId == languageId select obj).Count(); } catch (Exception ex) { operationResult = new OperationResult { Type = OperationResult.ResultType.Failure, Message = ex.StackTrace }; return 0; } }
public List<object> GetAll(string languageId, out OperationResult operationResult) { return Common.Instance.SelectList<VideoAlbum> (obj => obj.LanguageId == languageId, out operationResult) .ToList<object>(); }
public List<object> GetBySupportTypeId(string languageId, Guid SupportTypeId, out OperationResult operationResult) { return Common.Instance.SelectList<Support> (obj => obj.LanguageId == languageId && obj.SupportTypeId == SupportTypeId, out operationResult) .ToList<object>(); }
public void Update(VideoAlbum obj, out OperationResult operationResult) { lock (Lock) { if (obj == null) { operationResult = new OperationResult { Type = OperationResult.ResultType.Warning }; return; } Common.Instance.Update (obj, objs => objs.VideoAlbumId == obj.VideoAlbumId && objs.LanguageId == obj.LanguageId, out operationResult); } }
public List<object> GetBySupportTypeIdOrderByOrderVisible(string languageId, Guid SupportTypeId, out OperationResult operationResult) { return Common.Instance.SelectList<Support> (obj => obj.LanguageId == languageId && obj.SupportTypeId == SupportTypeId && obj.Visible == true, out operationResult) .OrderBy(obj => obj.Order) .ToList<object>(); }
public void Insert(VideoAlbum obj, out OperationResult operationResult) { lock (Lock) { if (obj == null) { operationResult = new OperationResult { Type = OperationResult.ResultType.Warning }; } else { Common.Instance.Insert(obj, out operationResult); } } }
public RssProvider GetById(string languageId, Guid id, out OperationResult operationResult) { return Common.Instance.SelectFirstOrDefault<RssProvider> (obj => obj.RssProviderId == id && obj.LanguageId == languageId, out operationResult); }
public void Update(Registration obj, out OperationResult operationResult) { lock (Lock) { if (obj == null) { operationResult = new OperationResult { Type = OperationResult.ResultType.Warning }; return; } Common.Instance.Update (obj, objs => objs.RegistrationId == obj.RegistrationId, out operationResult); } }
public VideoAlbum GetById(string languageId, Guid id, out OperationResult operationResult) { return Common.Instance.SelectFirstOrDefault<VideoAlbum> (obj => obj.VideoAlbumId == id && obj.LanguageId == languageId, out operationResult); }
public NewsComment GetById(string languageId, Guid id, out OperationResult operationResult) { return Common.Instance.SelectFirstOrDefault<NewsComment> (obj => obj.NewsCommentId == id && obj.LanguageId == languageId, out operationResult); }
public Registration GetById(Guid id, out OperationResult operationResult) { return Common.Instance.SelectFirstOrDefault<Registration> (obj => obj.RegistrationId == id, out operationResult); }
public List<object> GetPaging(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.VideoAlbum where obj.LanguageId == languageId select obj).OrderBy(obj => obj.CreateDate).Skip(pageSize * (pageNumber - 1)).Take(pageSize).ToList<object>(); } catch (Exception) { operationResult = new OperationResult { Type = OperationResult.ResultType.Warning }; return null; } }
public List<object> GetAll(out OperationResult operationResult) { return Common.Instance.SelectList<Registration> (null, out operationResult) .ToList<object>(); }