コード例 #1
0
        /// <summary>
        /// Get all data to fill combo box
        /// </summary>
        /// <param name="error"></param>
        /// <returns></returns>
        public List <ModelNotifiedForProducts> GetAll_Products(out string error)
        {
            ProductsGenericREST             ProductsGenericREST      = new ProductsGenericREST(wpfConfig);
            List <ModelNotifiedForProducts> modelNotifiedForProducts = ProductsGenericREST.GetAll <ModelNotifiedForProducts>(100, 0, out error);

            return(modelNotifiedForProducts);
        }
コード例 #2
0
        public void DeleteData(ModelNotifiedForProducts modelNotifiedForProducts, out string error)
        {
            ProductsGenericREST ProductsGenericREST = new ProductsGenericREST(wpfConfig);
            DeleteProductsView  deleteProductsView  = new DeleteProductsView();

            Cloner.CopyAllTo(typeof(ModelNotifiedForProducts), modelNotifiedForProducts, typeof(DeleteProductsView), deleteProductsView);
            ProductsGenericREST.Delete(deleteProductsView, out error);
        }
コード例 #3
0
        public void AddData(ModelNotifiedForProducts modelNotifiedForProducts, out string error)
        {
            ProductsGenericREST ProductsGenericREST = new ProductsGenericREST(wpfConfig);
            CreateProductsView  createProductsView  = new CreateProductsView();

            Cloner.CopyAllTo(typeof(ModelNotifiedForProducts), modelNotifiedForProducts, typeof(CreateProductsView), createProductsView);
            ProductsGenericREST.Insert(createProductsView, out error);
        }
コード例 #4
0
        public void SaveData(ModelNotifiedForProducts modelNotifiedForProducts, out string error)
        {
            ProductsGenericREST ProductsGenericREST = new ProductsGenericREST(wpfConfig);
            UpdateProductsView  updateProductsView  = new UpdateProductsView();

            Cloner.CopyAllTo(typeof(ModelNotifiedForProducts), modelNotifiedForProducts, typeof(UpdateProductsView), updateProductsView);
            ProductsGenericREST.Update(updateProductsView, out error);
        }
コード例 #5
0
        public ModelNotifiedForProducts GetProductsByID(int ProductID, out string error)
        {
            error = null;
            ProductsGenericREST      ProductsGenericREST      = new ProductsGenericREST(wpfConfig);
            GetProductsView          getProductsView          = ProductsGenericREST.GetByPK <GetProductsView>(ProductID, out error)[0];
            ModelNotifiedForProducts modelNotifiedForProducts = new ModelNotifiedForProducts();

            Cloner.CopyAllTo(typeof(GetProductsView), getProductsView, typeof(ModelNotifiedForProducts), modelNotifiedForProducts);
            return(modelNotifiedForProducts);
        }
コード例 #6
0
        public List <ModelNotifiedForProducts> GetAllProducts(out string error)
        {
            ProductsGenericREST             ProductsGenericREST      = new ProductsGenericREST(wpfConfig);
            List <ModelNotifiedForProducts> modelNotifiedForProducts = ProductsGenericREST.GetAll <ModelNotifiedForProducts>(100, 0, out error);

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

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

            return(modelNotifiedForProducts);
        }