Example #1
0
        //private void CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
        //{
        //Notify("IncludeFolders");
        //}



        public List <ModelNotifiedForCustomerCustomerDemo> GetAllCustomerCustomerDemo(out string error)
        {
            error = null;
            try
            {
                CustomerCustomerDemoBsn                     bsn           = new CustomerCustomerDemoBsn(wpfConfig);
                List <CustomerCustomerDemoInfo>             dbItems       = bsn.GetAll();
                List <ModelNotifiedForCustomerCustomerDemo> notifiedItems = new List <ModelNotifiedForCustomerCustomerDemo>();

                foreach (CustomerCustomerDemoInfo dbItem in dbItems)
                {
                    ModelNotifiedForCustomerCustomerDemo itemToAdd = new ModelNotifiedForCustomerCustomerDemo();
                    Cloner.CopyAllTo(typeof(CustomerCustomerDemoInfo), dbItem, typeof(ModelNotifiedForCustomerCustomerDemo), itemToAdd);
                    itemToAdd.ItemChanged = false;
                    itemToAdd.NewItem     = false;
                    notifiedItems.Add(itemToAdd);
                }

                return(notifiedItems);
            }
            catch (Exception ex)
            {
                error = ex.Message;
            }
            return(null);
        }
Example #2
0
        //private void CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
        //{
        //Notify("IncludeFolders");
        //}



        public List <ModelNotifiedForOrderDetails> GetAllOrderDetails(out string error)
        {
            error = null;
            try
            {
                OrderDetailsBsn                     bsn           = new OrderDetailsBsn(wpfConfig);
                List <OrderDetailsInfo>             dbItems       = bsn.GetAll();
                List <ModelNotifiedForOrderDetails> notifiedItems = new List <ModelNotifiedForOrderDetails>();

                foreach (OrderDetailsInfo dbItem in dbItems)
                {
                    ModelNotifiedForOrderDetails itemToAdd = new ModelNotifiedForOrderDetails();
                    Cloner.CopyAllTo(typeof(OrderDetailsInfo), dbItem, typeof(ModelNotifiedForOrderDetails), itemToAdd);
                    itemToAdd.ItemChanged = false;
                    itemToAdd.NewItem     = false;
                    notifiedItems.Add(itemToAdd);
                }

                return(notifiedItems);
            }
            catch (Exception ex)
            {
                error = ex.Message;
            }
            return(null);
        }
Example #3
0
        private void LoadNxNComboFor_EmployeeTerritories(EmployeesDataContext dataContext, out string error)
        {
            List <ModelNotifiedForTerritories> allTerritories = GetAllTerritories(out error);

            if (dataContext == null)
            {
                return;
            }
            var item = dataContext.modelNotifiedForEmployeesMain;
            List <ModelNotifiedForEmployeeTerritories> listEmployeeTerritories = GetAllEmployeeTerritories(item.EmployeeID, out error);
            List <ModelNotifiedForTerritories>         comboItens = new List <ModelNotifiedForTerritories>();

            foreach (ModelNotifiedForTerritories item2 in allTerritories)
            {
                ModelNotifiedForEmployeeTerritories aux = listEmployeeTerritories.Where(x => x.TerritoryID == item2.TerritoryID).FirstOrDefault();
                bool existsInDB = (aux != null);
                ModelNotifiedForTerritories newComboItem = new ModelNotifiedForTerritories();
                Cloner.CopyAllTo(typeof(ModelNotifiedForTerritories), item2, typeof(ModelNotifiedForTerritories), newComboItem);
                if (existsInDB)
                {
                    newComboItem.Check_Status = true;
                }
                else
                {
                    newComboItem.Check_Status = false;
                }
                comboItens.Add(newComboItem);
            }

            item.LookDownComboDataTerritories = comboItens.OrderBy(x => x.TerritoryDescription).ToList();
        }
Example #4
0
        //private void CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
        //{
        //Notify("IncludeFolders");
        //}



        public List <ModelNotifiedForTagEmployee> GetAllTagEmployee(out string error)
        {
            error = null;
            try
            {
                TagEmployeeBsn                     bsn           = new TagEmployeeBsn(wpfConfig);
                List <TagEmployeeInfo>             dbItems       = bsn.GetAll();
                List <ModelNotifiedForTagEmployee> notifiedItems = new List <ModelNotifiedForTagEmployee>();

                foreach (TagEmployeeInfo dbItem in dbItems)
                {
                    ModelNotifiedForTagEmployee itemToAdd = new ModelNotifiedForTagEmployee();
                    Cloner.CopyAllTo(typeof(TagEmployeeInfo), dbItem, typeof(ModelNotifiedForTagEmployee), itemToAdd);
                    itemToAdd.ItemChanged = false;
                    itemToAdd.NewItem     = false;
                    notifiedItems.Add(itemToAdd);
                }

                return(notifiedItems);
            }
            catch (Exception ex)
            {
                error = ex.Message;
            }
            return(null);
        }
Example #5
0
        //private void CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
        //{
        //Notify("IncludeFolders");
        //}



        public List <ModelNotifiedForRegion> GetAllRegion(out string error)
        {
            error = null;
            try
            {
                RegionBsn                     bsn           = new RegionBsn(wpfConfig);
                List <RegionInfo>             dbItems       = bsn.GetAll();
                List <ModelNotifiedForRegion> notifiedItems = new List <ModelNotifiedForRegion>();

                foreach (RegionInfo dbItem in dbItems)
                {
                    ModelNotifiedForRegion itemToAdd = new ModelNotifiedForRegion();
                    Cloner.CopyAllTo(typeof(RegionInfo), dbItem, typeof(ModelNotifiedForRegion), itemToAdd);
                    itemToAdd.ItemChanged = false;
                    itemToAdd.NewItem     = false;
                    notifiedItems.Add(itemToAdd);
                }

                return(notifiedItems);
            }
            catch (Exception ex)
            {
                error = ex.Message;
            }
            return(null);
        }
Example #6
0
        /// <summary>
        /// Get all itens filtering direct in DB. Up: More optimized because filters DB. Down: less flexible, don't support dynamic filters.
        /// </summary>
        /// <param name="generalBodyGet"></param>
        /// <param name="error"></param>
        /// <returns></returns>
        public List <GetTagView> GetAllWithDBFilter(GeneralBodyGet generalBodyGet, out RestExceptionError error)
        {
            try
            {
                if ((generalBodyGet == null) || (generalBodyGet.Filters == null) || (generalBodyGet.Filters.Count == 0))
                {
                    error = new RestExceptionError();
                    error.ExceptionMessage = "";
                    error.InternalMessage  = "Url does not contains filter section";
                }

                error = null;
                TagBsn bsn = new TagBsn(restConfig);
                List <DataFilterExpressionDB> dbFilter = HelperRESTFilterToDB.FilterRestFilterToDBExpression(generalBodyGet.Filters);
                List <TagInfo>    dbItems = bsn.GetAll(dbFilter);
                List <GetTagView> result  = new List <GetTagView>();
                foreach (TagInfo item in dbItems)
                {
                    GetTagView view = new GetTagView();
                    Cloner.CopyAllTo(typeof(TagInfo), item, typeof(GetTagView), view);
                    result.Add(view);
                }

                return(result);
            }
            catch (Exception ex)
            {
                error = new RestExceptionError();
                error.ExceptionMessage = ex.Message;
            }
            return(null);
        }
Example #7
0
        /// <summary>
        /// Get all itens to populate NXN relation used in ComboNxNEmployeeTerritories
        /// </summary>
        public List <ModelNotifiedForEmployeeTerritories> GetAllEmployeeTerritories(int EmployeeID, out string error)
        {
            error = null;
            try
            {
                EmployeeTerritoriesBsn  bsn    = new EmployeeTerritoriesBsn(wpfConfig);
                EmployeeTerritoriesInfo filter = new EmployeeTerritoriesInfo();
                filter.EmployeeID = EmployeeID;

                List <EmployeeTerritoriesInfo>             dbItems       = bsn.GetSome(filter);
                List <ModelNotifiedForEmployeeTerritories> notifiedItems = new List <ModelNotifiedForEmployeeTerritories>();

                foreach (EmployeeTerritoriesInfo dbItem in dbItems)
                {
                    ModelNotifiedForEmployeeTerritories itemToAdd = new ModelNotifiedForEmployeeTerritories();
                    Cloner.CopyAllTo(typeof(EmployeeTerritoriesInfo), dbItem, typeof(ModelNotifiedForEmployeeTerritories), itemToAdd);
                    itemToAdd.ItemChanged = false;
                    notifiedItems.Add(itemToAdd);
                }

                return(notifiedItems);
            }
            catch (Exception ex)
            {
                error = ex.Message;
            }
            return(null);
        }
Example #8
0
        /// <summary>
        /// Get all LookUp itens to populate NXN relation used in ComboNxNEmployeeTerritories
        /// </summary>
        public List <ModelNotifiedForTerritories> GetAllTerritories(out string error)
        {
            error = null;
            try
            {
                TerritoriesBsn                     bsn           = new TerritoriesBsn(wpfConfig);
                List <TerritoriesInfo>             dbItems       = bsn.GetAll();
                List <ModelNotifiedForTerritories> notifiedItems = new List <ModelNotifiedForTerritories>();

                foreach (TerritoriesInfo dbItem in dbItems)
                {
                    ModelNotifiedForTerritories itemToAdd = new ModelNotifiedForTerritories();
                    Cloner.CopyAllTo(typeof(TerritoriesInfo), dbItem, typeof(ModelNotifiedForTerritories), itemToAdd);
                    itemToAdd.ItemChanged = false;
                    notifiedItems.Add(itemToAdd);
                }

                return(notifiedItems);
            }
            catch (Exception ex)
            {
                error = ex.Message;
            }
            return(null);
        }
Example #9
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);
        }
Example #10
0
        public void AddData(ModelNotifiedForOrders modelNotifiedForOrders, out string error)
        {
            OrdersGenericREST OrdersGenericREST = new OrdersGenericREST(wpfConfig);
            CreateOrdersView  createOrdersView  = new CreateOrdersView();

            Cloner.CopyAllTo(typeof(ModelNotifiedForOrders), modelNotifiedForOrders, typeof(CreateOrdersView), createOrdersView);
            OrdersGenericREST.Insert(createOrdersView, out error);
        }
Example #11
0
        public void DeleteData(ModelNotifiedForOrders modelNotifiedForOrders, out string error)
        {
            OrdersGenericREST OrdersGenericREST = new OrdersGenericREST(wpfConfig);
            DeleteOrdersView  deleteOrdersView  = new DeleteOrdersView();

            Cloner.CopyAllTo(typeof(ModelNotifiedForOrders), modelNotifiedForOrders, typeof(DeleteOrdersView), deleteOrdersView);
            OrdersGenericREST.Delete(deleteOrdersView, out error);
        }
Example #12
0
        public void DeleteData(ModelNotifiedForCategories modelNotifiedForCategories, out string error)
        {
            CategoriesBsn  bsn    = new CategoriesBsn(wpfConfig);
            CategoriesInfo dbItem = new CategoriesInfo();

            Cloner.CopyAllTo(typeof(ModelNotifiedForCategories), modelNotifiedForCategories, typeof(CategoriesInfo), dbItem);
            bsn.DeleteByID(dbItem, out error);
        }
Example #13
0
        public void DeleteData(ModelNotifiedForRegion modelNotifiedForRegion, out string error)
        {
            RegionBsn  bsn    = new RegionBsn(wpfConfig);
            RegionInfo dbItem = new RegionInfo();

            Cloner.CopyAllTo(typeof(ModelNotifiedForRegion), modelNotifiedForRegion, typeof(RegionInfo), dbItem);
            bsn.DeleteByID(dbItem, out error);
        }
Example #14
0
        public void AddData(ModelNotifiedForTagEmployee modelNotifiedForTagEmployee, out string error)
        {
            TagEmployeeGenericREST TagEmployeeGenericREST = new TagEmployeeGenericREST(wpfConfig);
            CreateTagEmployeeView  createTagEmployeeView  = new CreateTagEmployeeView();

            Cloner.CopyAllTo(typeof(ModelNotifiedForTagEmployee), modelNotifiedForTagEmployee, typeof(CreateTagEmployeeView), createTagEmployeeView);
            TagEmployeeGenericREST.Insert(createTagEmployeeView, out error);
        }
Example #15
0
        public void AddData(ModelNotifiedForEmployees modelNotifiedForEmployees, out string error)
        {
            EmployeesGenericREST EmployeesGenericREST = new EmployeesGenericREST(wpfConfig);
            CreateEmployeesView  createEmployeesView  = new CreateEmployeesView();

            Cloner.CopyAllTo(typeof(ModelNotifiedForEmployees), modelNotifiedForEmployees, typeof(CreateEmployeesView), createEmployeesView);
            EmployeesGenericREST.Insert(createEmployeesView, out error);
        }
Example #16
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);
        }
Example #17
0
        public void SaveData(ModelNotifiedForTagEmployee modelNotifiedForTagEmployee, out string error)
        {
            TagEmployeeGenericREST TagEmployeeGenericREST = new TagEmployeeGenericREST(wpfConfig);
            UpdateTagEmployeeView  updateTagEmployeeView  = new UpdateTagEmployeeView();

            Cloner.CopyAllTo(typeof(ModelNotifiedForTagEmployee), modelNotifiedForTagEmployee, typeof(UpdateTagEmployeeView), updateTagEmployeeView);
            TagEmployeeGenericREST.Update(updateTagEmployeeView, out error);
        }
Example #18
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);
        }
Example #19
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);
        }
Example #20
0
        public void DeleteData(ModelNotifiedForProducts modelNotifiedForProducts, out string error)
        {
            ProductsBsn  bsn    = new ProductsBsn(wpfConfig);
            ProductsInfo dbItem = new ProductsInfo();

            Cloner.CopyAllTo(typeof(ModelNotifiedForProducts), modelNotifiedForProducts, typeof(ProductsInfo), dbItem);
            bsn.DeleteByID(dbItem, out error);
        }
Example #21
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);
        }
Example #22
0
        public void SaveData(ModelNotifiedForEmployeeTerritories modelNotifiedForEmployeeTerritories, out string error)
        {
            EmployeeTerritoriesGenericREST EmployeeTerritoriesGenericREST = new EmployeeTerritoriesGenericREST(wpfConfig);
            UpdateEmployeeTerritoriesView  updateEmployeeTerritoriesView  = new UpdateEmployeeTerritoriesView();

            Cloner.CopyAllTo(typeof(ModelNotifiedForEmployeeTerritories), modelNotifiedForEmployeeTerritories, typeof(UpdateEmployeeTerritoriesView), updateEmployeeTerritoriesView);
            EmployeeTerritoriesGenericREST.Update(updateEmployeeTerritoriesView, out error);
        }
Example #23
0
        public void DeleteData(ModelNotifiedForTagEmployee modelNotifiedForTagEmployee, out string error)
        {
            TagEmployeeBsn  bsn    = new TagEmployeeBsn(wpfConfig);
            TagEmployeeInfo dbItem = new TagEmployeeInfo();

            Cloner.CopyAllTo(typeof(ModelNotifiedForTagEmployee), modelNotifiedForTagEmployee, typeof(TagEmployeeInfo), dbItem);
            bsn.DeleteByID(dbItem, out error);
        }
Example #24
0
        public void DeleteData(ModelNotifiedForRegion modelNotifiedForRegion, out string error)
        {
            RegionGenericREST RegionGenericREST = new RegionGenericREST(wpfConfig);
            DeleteRegionView  deleteRegionView  = new DeleteRegionView();

            Cloner.CopyAllTo(typeof(ModelNotifiedForRegion), modelNotifiedForRegion, typeof(DeleteRegionView), deleteRegionView);
            RegionGenericREST.Delete(deleteRegionView, out error);
        }
Example #25
0
        public void SaveData(ModelNotifiedForOrders modelNotifiedForOrders, out string error)
        {
            OrdersGenericREST OrdersGenericREST = new OrdersGenericREST(wpfConfig);
            UpdateOrdersView  updateOrdersView  = new UpdateOrdersView();

            Cloner.CopyAllTo(typeof(ModelNotifiedForOrders), modelNotifiedForOrders, typeof(UpdateOrdersView), updateOrdersView);
            OrdersGenericREST.Update(updateOrdersView, out error);
        }
Example #26
0
        public void DeleteData(ModelNotifiedForOrderDetails modelNotifiedForOrderDetails, out string error)
        {
            OrderDetailsBsn  bsn    = new OrderDetailsBsn(wpfConfig);
            OrderDetailsInfo dbItem = new OrderDetailsInfo();

            Cloner.CopyAllTo(typeof(ModelNotifiedForOrderDetails), modelNotifiedForOrderDetails, typeof(OrderDetailsInfo), dbItem);
            bsn.DeleteByID(dbItem, out error);
        }
Example #27
0
        public void DeleteData(ModelNotifiedForTagEmployee modelNotifiedForTagEmployee, out string error)
        {
            TagEmployeeGenericREST TagEmployeeGenericREST = new TagEmployeeGenericREST(wpfConfig);
            DeleteTagEmployeeView  deleteTagEmployeeView  = new DeleteTagEmployeeView();

            Cloner.CopyAllTo(typeof(ModelNotifiedForTagEmployee), modelNotifiedForTagEmployee, typeof(DeleteTagEmployeeView), deleteTagEmployeeView);
            TagEmployeeGenericREST.Delete(deleteTagEmployeeView, out error);
        }
Example #28
0
        public void AddData(ModelNotifiedForRegion modelNotifiedForRegion, out string error)
        {
            RegionGenericREST RegionGenericREST = new RegionGenericREST(wpfConfig);
            CreateRegionView  createRegionView  = new CreateRegionView();

            Cloner.CopyAllTo(typeof(ModelNotifiedForRegion), modelNotifiedForRegion, typeof(CreateRegionView), createRegionView);
            RegionGenericREST.Insert(createRegionView, out error);
        }
Example #29
0
        public void DeleteData(ModelNotifiedForEmployees modelNotifiedForEmployees, out string error)
        {
            EmployeesGenericREST EmployeesGenericREST = new EmployeesGenericREST(wpfConfig);
            DeleteEmployeesView  deleteEmployeesView  = new DeleteEmployeesView();

            Cloner.CopyAllTo(typeof(ModelNotifiedForEmployees), modelNotifiedForEmployees, typeof(DeleteEmployeesView), deleteEmployeesView);
            EmployeesGenericREST.Delete(deleteEmployeesView, out error);
        }
Example #30
0
        public void DeleteData(ModelNotifiedForCustomerDemographics modelNotifiedForCustomerDemographics, out string error)
        {
            CustomerDemographicsBsn  bsn    = new CustomerDemographicsBsn(wpfConfig);
            CustomerDemographicsInfo dbItem = new CustomerDemographicsInfo();

            Cloner.CopyAllTo(typeof(ModelNotifiedForCustomerDemographics), modelNotifiedForCustomerDemographics, typeof(CustomerDemographicsInfo), dbItem);
            bsn.DeleteByID(dbItem, out error);
        }