Example #1
0
        public GetFiscalsResponse GetFiscalsCreatedOrConfirmedWithMe(AjaxGetRequest request, string employeeID)
        {
            GetFiscalsResponse response = new GetFiscalsResponse();

            try
            {
                int index = (request.PageNumber - 1) * request.PageSize;
                int count = request.PageSize;

                string query = "From Fiscal Where CreateEmployee.ID = '" + employeeID + "' Or ConfirmEmployee.ID = '" + employeeID + "'";

                Infrastructure.Domain.Response <Fiscal> fiscalsResponse = _fiscalRepository
                                                                          .FindAll(query, index, count);

                IEnumerable <FiscalView> fiscals = fiscalsResponse.data
                                                   .ConvertToFiscalViews();

                response.FiscalViews = fiscals;
                response.Count       = fiscalsResponse.totalCount;
            }
            catch (Exception ex)
            {
                throw;
            }

            return(response);
        }
Example #2
0
        // Added By zafari



        public GetProductsResponse GetProducts(AjaxGetRequest request)
        {
            GetProductsResponse response = new GetProductsResponse();

            try
            {
                int index = (request.PageNumber - 1) * request.PageSize;
                int count = request.PageSize;

                Infrastructure.Domain.Response <Product> productsResponse = _productRepository
                                                                            .FindAll(index, count);

                IEnumerable <ProductView> products = productsResponse.data
                                                     .ConvertToProductViews();

                response.ProductViews = products;
                response.Count        = productsResponse.totalCount;
            }
            catch (Exception ex)
            {
                throw;
            }

            return(response);
        }
Example #3
0
        /// <summary>
        /// برای نمایش جدولی نماها در تنظیمات
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public GetQueriesResponse GetQueries(AjaxGetRequest request)
        {
            GetQueriesResponse response = new GetQueriesResponse();

            try
            {
                int index = (request.PageNumber - 1) * request.PageSize;
                int count = request.PageSize;

                Infrastructure.Domain.Response <Query> querysResponse = _queryRepository
                                                                        .FindAll(index, count);

                IEnumerable <QueryView> querys = querysResponse.data
                                                 .ConvertToQueryViews().OrderBy(o => o.CreateDate);

                response.QueryViews = querys;
                response.TotalCount = querysResponse.totalCount;
            }
            catch (Exception ex)
            {
                throw;
            }

            return(response);
        }
Example #4
0
        public GetGeneralResponse <IEnumerable <LevelTypeView> > GetLevelTypes(AjaxGetRequest request)
        {
            GetGeneralResponse <IEnumerable <LevelTypeView> > response = new GetGeneralResponse <IEnumerable <LevelTypeView> >();

            try
            {
                int index = (request.PageNumber - 1) * request.PageSize;
                int count = request.PageSize;

                Infrastructure.Domain.Response <LevelType> levelTypesResponse = _levelTypeRepository.FindAll(index, count);

                response.data       = levelTypesResponse.data.ConvertToLevelTypeViews();
                response.totalCount = levelTypesResponse.totalCount;
            }
            catch (Exception ex)
            {
                throw;
            }

            return(response);
        }
Example #5
0
        public GetGeneralResponse <IEnumerable <CustomerLevelView> > GetLevelHistory(Guid customerID, int pageSize, int pageNumber)
        {
            Infrastructure.Querying.Query query = new Infrastructure.Querying.Query();
            Criterion criteria = new Criterion("Customer.ID", customerID, CriteriaOperator.Equal);

            query.Add(criteria);

            int index = (pageNumber - 1) * pageSize;
            int count = pageSize;

            Infrastructure.Domain.Response <CustomerLevel> customerLevelResponse = _customerLevelRepository.FindBy(query, index, count);

            GetGeneralResponse <IEnumerable <CustomerLevelView> > response = new GetGeneralResponse <IEnumerable <CustomerLevelView> >();

            response.data       = customerLevelResponse.data.ConvertToCustomerLevelViews();
            response.totalCount = customerLevelResponse.totalCount;

            string temp = response.data.FirstOrDefault().CreateDate;
            var    list = response.data.ToArray();

            if (temp != null)
            {
                for (int i = 1; i <= list.Length - 1; i++)
                {
                    if (i == 1)
                    {
                        list[i - 1].WaitingDays = PersianDateTime.DateDiff(temp, list[i].CreateDate);
                    }
                    else
                    {
                        list[i - 1].WaitingDays = PersianDateTime.DateDiff(list[i - 1].CreateDate, list[i].CreateDate);
                    }
                }
            }
            list.Last().WaitingDays = PersianDateTime.DateDiff(list.Last().CreateDate, PersianDateTime.Now);
            response.data = list;

            return(response);
        }
Example #6
0
        public GetStoresResponse GetStores(AjaxGetRequest request)
        {
            GetStoresResponse response = new GetStoresResponse();

            try
            {
                int index = (request.PageNumber - 1) * request.PageSize;
                int count = request.PageSize;

                Infrastructure.Domain.Response <Store> storesResponse = _storeRepository.FindAll(index, count);

                IEnumerable <StoreView> stores = storesResponse.data.ConvertToStoreViews();

                response.StoreViews = stores;
                response.Count      = storesResponse.totalCount;
            }
            catch (Exception ex)
            {
                throw;
            }

            return(response);
        }