示例#1
0
 public List<object> GetAllOrderByName(string languageId, out OperationResult operationResult)
 {
     return Common.Instance.SelectList<NewsStatus>
         (null, out operationResult)
         .OrderBy(obj => obj.Name)
         .ToList<object>();
 }
示例#2
0
 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>();
 }
示例#3
0
 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>();
 }
示例#4
0
 public void Delete(Guid id, out OperationResult operationResult)
 {
     lock (Lock)
     {
         Common.Instance.Delete<EmailReceiver>
             (obj => obj.EmailReceiverId == id, out operationResult);
     }
 }
示例#5
0
 public void Delete(Guid id, out OperationResult operationResult)
 {
     lock (Lock)
     {
         Common.Instance.Delete<Registration>
             (obj => obj.RegistrationId == id, out operationResult);
     }
 }
示例#6
0
 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);
     }
 }
示例#7
0
 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);
     }
 }
示例#8
0
 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);
     }
 }
示例#9
0
 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);
     }
 }
示例#10
0
 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;
 }
示例#11
0
 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;
 }
示例#12
0
 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;
 }
示例#13
0
 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;
     }
 }
示例#14
0
 /// <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;
     }
 }
示例#15
0
 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;
     }
 }
示例#16
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;
     }
 }
示例#17
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;
     }
 }
示例#18
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;
     }
 }
示例#19
0
 public List<object> GetAll(string languageId, out OperationResult operationResult)
 {
     return Common.Instance.SelectList<VideoAlbum>
         (obj => obj.LanguageId == languageId, out operationResult)
         .ToList<object>();
 }
示例#20
0
 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>();
 }
示例#21
0
 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);
     }
 }
示例#22
0
 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>();
 }
示例#23
0
 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);
         }
     }
 }
示例#24
0
 public RssProvider GetById(string languageId, Guid id, out OperationResult operationResult)
 {
     return Common.Instance.SelectFirstOrDefault<RssProvider>
         (obj => obj.RssProviderId == id && obj.LanguageId == languageId, out operationResult);
 }
示例#25
0
 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);
     }
 }
示例#26
0
 public VideoAlbum GetById(string languageId, Guid id, out OperationResult operationResult)
 {
     return Common.Instance.SelectFirstOrDefault<VideoAlbum>
         (obj => obj.VideoAlbumId == id && obj.LanguageId == languageId, out operationResult);
 }
示例#27
0
 public NewsComment GetById(string languageId, Guid id, out OperationResult operationResult)
 {
     return Common.Instance.SelectFirstOrDefault<NewsComment>
         (obj => obj.NewsCommentId == id && obj.LanguageId == languageId, out operationResult);
 }
示例#28
0
 public Registration GetById(Guid id, out OperationResult operationResult)
 {
     return Common.Instance.SelectFirstOrDefault<Registration>
         (obj => obj.RegistrationId == id, out operationResult);
 }
示例#29
0
 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;
     }
 }
示例#30
0
 public List<object> GetAll(out OperationResult operationResult)
 {
     return Common.Instance.SelectList<Registration>
         (null, out operationResult)
         .ToList<object>();
 }