Exemple #1
0
 /// <summary>
 /// Retrieves Get Total Rows of GlobalSetting
 /// </summary>
 /// <returns>Int32 type object</returns>
 public Int32 GetRowCount()
 {
     using (GlobalSettingDataAccess data = new GlobalSettingDataAccess(ClientContext))
     {
         return(data.GetRowCount());
     }
 }
Exemple #2
0
 /// <summary>
 /// Retrieve list of GlobalSetting  by query String.
 /// <param name="query"></param>
 /// </summary>
 /// <returns>List of GlobalSetting</returns>
 public GlobalSettingList GetByQuery(String query)
 {
     using (GlobalSettingDataAccess data = new GlobalSettingDataAccess(ClientContext))
     {
         return(data.GetByQuery(query));
     }
 }
Exemple #3
0
 /// <summary>
 /// Retrieve list of GlobalSetting  by PageRequest.
 /// <param name="request"></param>
 /// </summary>
 /// <returns>List of GlobalSetting</returns>
 public GlobalSettingList GetPaged(PagedRequest request)
 {
     using (GlobalSettingDataAccess data = new GlobalSettingDataAccess(ClientContext))
     {
         return(data.GetPaged(request));
     }
 }
Exemple #4
0
 /// <summary>
 /// Retrieve list of GlobalSetting.
 /// no parameters required to be passed in.
 /// </summary>
 /// <returns>List of GlobalSetting</returns>
 public GlobalSettingList GetAll()
 {
     using (GlobalSettingDataAccess data = new GlobalSettingDataAccess(ClientContext))
     {
         return(data.GetAll());
     }
 }
Exemple #5
0
 /// <summary>
 /// Retrieve GlobalSetting data using unique ID
 /// </summary>
 /// <param name="_Id"></param>
 /// <returns>GlobalSetting Object</returns>
 public GlobalSetting Get(Int32 _Id)
 {
     using (GlobalSettingDataAccess data = new GlobalSettingDataAccess(ClientContext))
     {
         return(data.Get(_Id));
     }
 }
Exemple #6
0
 /// <summary>
 /// Delete operation for GlobalSetting
 /// <param name="_Id"></param>
 /// <returns></returns>
 private bool Delete(Int32 _Id)
 {
     using (GlobalSettingDataAccess data = new GlobalSettingDataAccess(ClientContext))
     {
         // return if code > 0
         return(data.Delete(_Id) > 0);
     }
 }
Exemple #7
0
        /// <summary>
        /// Retrieve list of GlobalSetting.
        /// </summary>
        /// <param name="fillChild"></param>
        /// <returns>List of GlobalSetting</returns>
        public GlobalSettingList GetAll(bool fillChild)
        {
            GlobalSettingList globalSettingList = new GlobalSettingList();

            using (GlobalSettingDataAccess data = new GlobalSettingDataAccess(ClientContext))
            {
                globalSettingList = data.GetAll();
            }
            if (fillChild)
            {
                foreach (GlobalSetting globalSettingObject in globalSettingList)
                {
                    FillGlobalSettingWithChilds(globalSettingObject, fillChild);
                }
            }
            return(globalSettingList);
        }
Exemple #8
0
        /// <summary>
        /// Update base of GlobalSetting Object.
        /// Data manipulation processing for: new, deleted, updated GlobalSetting
        /// </summary>
        /// <param name="globalSettingObject"></param>
        /// <returns></returns>
        public bool UpdateBase(GlobalSetting globalSettingObject)
        {
            // use of switch for different types of DML
            switch (globalSettingObject.RowState)
            {
            // insert new rows
            case BaseBusinessEntity.RowStateEnum.NewRow:
                return(Insert(globalSettingObject));

            // delete rows
            case BaseBusinessEntity.RowStateEnum.DeletedRow:
                return(Delete(globalSettingObject.Id));
            }
            // update rows
            using (GlobalSettingDataAccess data = new GlobalSettingDataAccess(ClientContext))
            {
                return(data.Update(globalSettingObject) > 0);
            }
        }
Exemple #9
0
 /// <summary>
 /// Insert new globalSetting.
 /// data manipulation for insertion of GlobalSetting
 /// </summary>
 /// <param name="globalSettingObject"></param>
 /// <returns></returns>
 private bool Insert(GlobalSetting globalSettingObject)
 {
     // new globalSetting
     using (GlobalSettingDataAccess data = new GlobalSettingDataAccess(ClientContext))
     {
         // insert to globalSettingObject
         Int32 _Id = data.Insert(globalSettingObject);
         // if successful, process
         if (_Id > 0)
         {
             globalSettingObject.Id = _Id;
             return(true);
         }
         else
         {
             return(false);
         }
     }
 }