Esempio n. 1
0
        /// <summary>
        /// Get all data to fill combo box
        /// </summary>
        /// <param name="error"></param>
        /// <returns></returns>
        public List <ModelNotifiedForCategories> GetAll_Categories(out string error)
        {
            CategoriesGenericREST             CategoriesGenericREST      = new CategoriesGenericREST(wpfConfig);
            List <ModelNotifiedForCategories> modelNotifiedForCategories = CategoriesGenericREST.GetAll <ModelNotifiedForCategories>(100, 0, out error);

            return(modelNotifiedForCategories);
        }
Esempio n. 2
0
        public void DeleteData(ModelNotifiedForCategories modelNotifiedForCategories, out string error)
        {
            CategoriesGenericREST CategoriesGenericREST = new CategoriesGenericREST(wpfConfig);
            DeleteCategoriesView  deleteCategoriesView  = new DeleteCategoriesView();

            Cloner.CopyAllTo(typeof(ModelNotifiedForCategories), modelNotifiedForCategories, typeof(DeleteCategoriesView), deleteCategoriesView);
            CategoriesGenericREST.Delete(deleteCategoriesView, out error);
        }
Esempio n. 3
0
        public void AddData(ModelNotifiedForCategories modelNotifiedForCategories, out string error)
        {
            CategoriesGenericREST CategoriesGenericREST = new CategoriesGenericREST(wpfConfig);
            CreateCategoriesView  createCategoriesView  = new CreateCategoriesView();

            Cloner.CopyAllTo(typeof(ModelNotifiedForCategories), modelNotifiedForCategories, typeof(CreateCategoriesView), createCategoriesView);
            CategoriesGenericREST.Insert(createCategoriesView, out error);
        }
Esempio n. 4
0
        public void SaveData(ModelNotifiedForCategories modelNotifiedForCategories, out string error)
        {
            CategoriesGenericREST CategoriesGenericREST = new CategoriesGenericREST(wpfConfig);
            UpdateCategoriesView  updateCategoriesView  = new UpdateCategoriesView();

            Cloner.CopyAllTo(typeof(ModelNotifiedForCategories), modelNotifiedForCategories, typeof(UpdateCategoriesView), updateCategoriesView);
            CategoriesGenericREST.Update(updateCategoriesView, out error);
        }
Esempio n. 5
0
        public ModelNotifiedForCategories GetCategoriesByID(int CategoryID, out string error)
        {
            error = null;
            CategoriesGenericREST      CategoriesGenericREST      = new CategoriesGenericREST(wpfConfig);
            GetCategoriesView          getCategoriesView          = CategoriesGenericREST.GetByPK <GetCategoriesView>(CategoryID, out error)[0];
            ModelNotifiedForCategories modelNotifiedForCategories = new ModelNotifiedForCategories();

            Cloner.CopyAllTo(typeof(GetCategoriesView), getCategoriesView, typeof(ModelNotifiedForCategories), modelNotifiedForCategories);
            return(modelNotifiedForCategories);
        }
Esempio n. 6
0
        public List <ModelNotifiedForCategories> GetAllCategories(out string error)
        {
            CategoriesGenericREST             CategoriesGenericREST      = new CategoriesGenericREST(wpfConfig);
            List <ModelNotifiedForCategories> modelNotifiedForCategories = CategoriesGenericREST.GetAll <ModelNotifiedForCategories>(100, 0, out error);

            if (!string.IsNullOrEmpty(error))
            {
                return(null);
            }

            //Initializing row status
            foreach (var item in modelNotifiedForCategories)
            {
                item.ItemChanged = false;
                item.NewItem     = false;
            }

            return(modelNotifiedForCategories);
        }