/// <summary>
        /// Returns a list of divisions for the specified company and selection criteria.
        /// </summary>
        /// <param name="param">The data table search criteria</param>
        /// <param name="companyId">The company for which divisions are required. </param>
        /// <returns>List of divisions</returns>
        public ActionResult DivisionList(MODEL.jQueryDataTableParamModel param, int?companyId = 0)
        {
            try
            {
                DivisionService       divisionService = new DivisionService();
                List <MODEL.Division> divisionList    = new List <MODEL.Division>();

                List <DivisionVO> divisionVOlist = divisionService.GetDivisionListByCompany(companyId);
                foreach (DivisionVO divisionVO in divisionVOlist)
                {
                    divisionList.Add(new MODEL.Division(divisionVO));
                }

                //get the field on with sorting needs to happen and set the
                //ordering function/delegate accordingly.
                int sortColumnIndex  = Convert.ToInt32(Request["iSortCol_0"]);
                var orderingFunction = GetDivisionOrderingFunction(sortColumnIndex);

                var result = GetFilteredObjectsOrderByAscending(param, divisionList, orderingFunction);
                return(result);
            }
            catch (Exception e)
            {
                return(new HttpStatusCodeAndErrorResult(500, e.Message));
            }
        }
        /// <summary>
        /// Gets the customer comment list
        /// </summary>
        /// <param name="param"></param>
        /// <returns>Customer comment List</returns>
        public ActionResult CustomerCommentList(MODEL.jQueryDataTableParamModel param)
        {
            try
            {
                List <Company>   companyList   = Session.GetUserAssociatedCompanyList();
                List <CompanyVO> companyVOList = new List <CompanyVO>();
                foreach (var item in companyList)
                {
                    //companyVOList.Add(new CompanyVO(item));
                    companyVOList.Add(item.Transpose());
                }

                CustomerCommentService       customerCommentService = new CustomerCommentService();
                List <MODEL.CustomerComment> customerCommentList    = new List <CustomerComment>();

                List <CustomerCommentVO> customerCommentVOList = customerCommentService.GetCustomerCommentList(companyVOList);

                foreach (var item in customerCommentVOList)
                {
                    customerCommentList.Add(new MODEL.CustomerComment(item));
                }

                //get the field on with sorting needs to happen and set the
                //ordering function/delegate accordingly.
                int sortColumnIndex  = Convert.ToInt32(Request["iSortCol_0"]);
                var orderingFunction = GetCustomerCommentOrderingFunction(sortColumnIndex);

                var result = GetFilteredObjects(param, customerCommentList, orderingFunction);
                return(result);
            }
            catch (Exception e)
            {
                return(new HttpStatusCodeAndErrorResult(500, e.Message));
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Get Sub ProductList by Product Id
        /// </summary>
        /// <param name="param"></param>
        /// <param name="productId">Product Id</param>
        /// <returns></returns>
        public ActionResult GetSubProductListById(MODEL.jQueryDataTableParamModel param, int productId)
        {
            try
            {
                List <MODEL.SubProduct> subProductList    = new List <MODEL.SubProduct>();
                SubProductService       subProductService = new SubProductService();

                List <SubProductVO> subProductVOList = subProductService.GetSubProductListById(productId);

                if (subProductList != null)
                {
                    foreach (SubProductVO subProductVO in subProductVOList)
                    {
                        subProductList.Add(new MODEL.SubProduct(subProductVO));
                    }
                }

                //get the field on with sorting needs to happen and set the
                //ordering function/delegate accordingly.
                int sortColumnIndex  = Convert.ToInt32(Request["iSortCol_0"]);
                var orderingFunction = GetSubProductOrderingFunction(sortColumnIndex);

                var result = GetFilteredObjectsOrderByAscending(param, subProductList, orderingFunction);
                return(result);
            }
            catch (Exception e)
            {
                return(new HttpStatusCodeAndErrorResult(500, e.Message));
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Get the list of EndUser based on companyId and customerId
        /// </summary>
        /// <param name="param"></param>
        /// <param name="companyId">company Id</param>
        /// <param name="customerId">customer Id</param>
        /// <returns>End User List</returns>
        public ActionResult EndUserList(MODEL.jQueryDataTableParamModel param, int companyId, int customerId)
        {
            try
            {
                EndUserService       enduserService = new EndUserService();
                List <MODEL.EndUser> enduserList    = new List <EndUser>();

                List <EndUserVO> enduserVOlist = enduserService.GetEndUserListByCompanyIdandCustomerId(companyId, customerId);

                foreach (var item in enduserVOlist)
                {
                    enduserList.Add(new MODEL.EndUser(item));
                }

                //get the field on with sorting needs to happen and set the
                //ordering function/delegate accordingly.
                int sortColumnIndex  = Convert.ToInt32(Request["iSortCol_0"]);
                var orderingFunction = GetEndUserOrderingFunction(sortColumnIndex);

                var result = GetFilteredObjects(param, enduserList, orderingFunction);
                return(result);
            }
            catch (Exception e)
            {
                return(new HttpStatusCodeAndErrorResult(500, e.Message));
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// Returns a list of inflation index for the selection criteria.
        /// </summary>
        /// <param name="param">The data table search criteria</param>
        /// <returns>List of inflation index</returns>
        public ActionResult InflationIndexList(MODEL.jQueryDataTableParamModel param)
        {
            try
            {
                List <MODEL.InflationIndex> inflationIndexList    = new List <MODEL.InflationIndex>();
                InflationIndexService       inflationIndexService = new InflationIndexService();
                List <InflationIndexVO>     inflationIndexVOlist  = inflationIndexService.GetInflationIndexList();
                foreach (InflationIndexVO inflationIndexVO in inflationIndexVOlist)
                {
                    inflationIndexList.Add(new MODEL.InflationIndex(inflationIndexVO));
                }

                //get the field on with sorting needs to happen and set the
                //ordering function/delegate accordingly.
                int sortColumnIndex  = Convert.ToInt32(Request["iSortCol_0"]);
                var orderingFunction = GetInflationIndexOrderingFunction(sortColumnIndex);

                var result = GetFilteredObjectsOrderByAscending(param, inflationIndexList, orderingFunction);
                return(result);
            }
            catch (Exception e)
            {
                return(new HttpStatusCodeAndErrorResult(500, e.Message));
            }
        }
Exemplo n.º 6
0
        /// <summary>
        /// Gets inflation index rates list by inflation index Id
        /// </summary>
        /// <param name="param">The params</param>
        /// <param name="inflationIndexId">Inflation Index Id</param>
        /// <returns>inflation index rate list</returns>
        public ActionResult GetInflationIndexRateListById(MODEL.jQueryDataTableParamModel param, int inflationIndexId)
        {
            try
            {
                InflationIndexRateService   inflationIndexRateService = new InflationIndexRateService();
                List <InflationIndexRateVO> inflationIndexRateVOList  = inflationIndexRateService.GetInflationIndexRateListById(inflationIndexId);

                List <MODEL.InflationIndexRate> inflationIndexRateList = new List <MODEL.InflationIndexRate>();
                if (inflationIndexRateVOList != null)
                {
                    foreach (InflationIndexRateVO inflationIndexRateVO in inflationIndexRateVOList)
                    {
                        inflationIndexRateList.Add(new MODEL.InflationIndexRate(inflationIndexRateVO));
                    }
                }

                //get the field on with sorting needs to happen and set the
                //ordering function/delegate accordingly.
                int sortColumnIndex  = Convert.ToInt32(Request["iSortCol_0"]);
                var orderingFunction = GetInflationIndexRateOrderingFunction(sortColumnIndex);

                var result = GetFilteredObjects(param, inflationIndexRateList, orderingFunction);
                return(result);
            }
            catch (Exception e)
            {
                return(new HttpStatusCodeAndErrorResult(500, e.Message));
            }
        }
        /// <summary>
        ///  Returns list of audit Reasons
        /// </summary>
        /// <param name="param">The filter an other parameters</param>
        /// <returns>List of audit reasons</returns>
        // GET: /Administration/AuditReasonList
        public ActionResult AuditReasonList(MODEL.jQueryDataTableParamModel param)
        {
            try
            {
                AuditReasonService       auditReasonService = new AuditReasonService();
                List <MODEL.AuditReason> auditReasonList    = new List <AuditReason>();


                //Get the list of Audit Reasons VO's
                List <AuditReasonVO> auditReasonVOList = auditReasonService.GetAuditReasonCodeVOList();

                foreach (var auditReasonVO in auditReasonVOList)
                {
                    MODEL.AuditReason auditReason = new MODEL.AuditReason(auditReasonVO);
                    auditReasonList.Add(auditReason);
                }


                //get the field on with sorting needs to happen and set the
                //ordering function/delegate accordingly.
                int sortColumnIndex  = Convert.ToInt32(Request["iSortCol_0"]);
                var orderingFunction = GetAuditReasonOrderingFunction(sortColumnIndex);

                var result = GetFilteredObjectsOrderByAscending(param, auditReasonList, orderingFunction);
                return(result);
            }
            catch (Exception e)
            {
                return(new HttpStatusCodeAndErrorResult(500, e.Message));
            }
        }
        /// <summary>
        /// Returns list of users
        /// </summary>
        /// <param name="param">The filter an other parameters</param>
        /// <returns>List of users</returns>
        // GET: /Administration/UserList
        public ActionResult UserList(MODEL.jQueryDataTableParamModel param)
        {
            try
            {
                List <MODEL.UserModel> userList    = new List <MODEL.UserModel>();
                UserService            userService = new UserService();
                string UserType = SessionHelper.GetUserType(Session);

                List <UserVO> userVOList = userService.GetUserList(UserType);

                foreach (var item in userVOList)
                {
                    userList.Add(new MODEL.UserModel(item));
                }

                //get the field on with sorting needs to happen and set the
                //ordering function/delegate accordingly.
                int sortColumnIndex  = Convert.ToInt32(Request["iSortCol_0"]);
                var orderingFunction = GetUserOrderingFunction(sortColumnIndex);

                var result = GetFilteredObjects(param, userList, orderingFunction);
                return(result);
            }
            catch (Exception e)
            {
                return(new HttpStatusCodeAndErrorResult(500, e.Message));
            }
        }
        /// <summary>
        /// Returns list of P&L for the specified company,costcenter and selection criteria.
        /// </summary>
        /// <param name="param"></param>
        /// <param name="costcenterId">costcenter id</param>
        /// <param name="companyId">company id</param>
        /// <returns>ProfitLoss List</returns>
        public ActionResult ProfitLossList(MODEL.jQueryDataTableParamModel param, int?companyId = 0)
        {
            try
            {
                ProfitLossService       profitlossService = new ProfitLossService();
                List <MODEL.ProfitLoss> profitlossList    = new List <MODEL.ProfitLoss>();

                List <ProfitLossVO> profitlossVOlist = profitlossService.GetPandLListByCompany(companyId);

                foreach (ProfitLossVO profitlossVO in profitlossVOlist)
                {
                    profitlossList.Add(new MODEL.ProfitLoss(profitlossVO));
                }

                //get the field on with sorting needs to happen and set the
                //ordering function/delegate accordingly.
                int sortColumnIndex  = Convert.ToInt32(Request["iSortCol_0"]);
                var orderingFunction = GetProfitLossOrderingFunction(sortColumnIndex);

                var result = GetFilteredObjects(param, profitlossList, orderingFunction);
                return(result);
            }
            catch (Exception e)
            {
                return(new HttpStatusCodeAndErrorResult(500, e.Message));
            }
        }
        /// <summary>
        /// Returns list of products
        /// </summary>
        /// <param name="param">The filter an other parameters</param>
        /// <returns>List of Products</returns>
        //// GET: /Administration/ProductList
        public ActionResult ProductList(MODEL.jQueryDataTableParamModel param)
        {
            try
            {
                ProductService   productService = new ProductService();
                List <ProductVO> productVOList  = productService.GetProductList();

                MODEL.Product product = new MODEL.Product();

                List <MODEL.Product> productList = new List <MODEL.Product>();
                foreach (var item in productVOList)
                {
                    productList.Add(new MODEL.Product(item));
                }

                //get the field on with sorting needs to happen and set the
                //ordering function/delegate accordingly.
                int sortColumnIndex  = Convert.ToInt32(Request["iSortCol_0"]);
                var orderingFunction = GetProductOrderingFunction(sortColumnIndex);

                var result = GetFilteredObjectsOrderByAscending(param, productList, orderingFunction);

                return(result);
            }
            catch (Exception e)
            {
                //ModelState.AddModelError("", e.Message);
                //return GetFilteredObjects(param, new List<MODEL.Product>(), null);
                return(new HttpStatusCodeAndErrorResult(500, e.Message));
            }
        }
Exemplo n.º 11
0
        /// <summary>
        /// Returns a list of currency
        /// </summary>
        /// <param name="param">The filter an other parameters</param>
        /// <returns>List of currency</returns>
        // GET: /Administration/CurrencyList
        public ActionResult CurrencyList(MODEL.jQueryDataTableParamModel param)
        {
            try
            {
                CurrencyService   currencyService = new CurrencyService();
                List <CurrencyVO> currencyVOList  = currencyService.GetCurrencyList();

                List <MODEL.Currency> currencies = new List <MODEL.Currency>();
                foreach (var item in currencyVOList)
                {
                    currencies.Add(new Models.Currency(item));
                }

                //get the field on with sorting needs to happen and set the
                //ordering function/delegate accordingly.
                int sortColumnIndex  = Convert.ToInt32(Request["iSortCol_0"]);
                var orderingFunction = GetCurrencyOrderingFunction(sortColumnIndex);

                var result = GetFilteredObjects(param, currencies, orderingFunction);
                return(result);
            }
            catch (Exception e)
            {
                return(new HttpStatusCodeAndErrorResult(500, e.Message));
            }
        }
Exemplo n.º 12
0
        /// <summary>
        /// Gets the list of contract milestone
        /// </summary>
        /// <param name="param"></param>
        /// <param name="contractMaintenanceId">ContractMaintenance Id</param>
        /// <returns>List of Milestones</returns>
        public ActionResult GetContractMilestoneList(MODEL.jQueryDataTableParamModel param, int contractMaintenanceId)
        {
            try
            {
                MilestoneService   milestoneService = new MilestoneService();
                List <MilestoneVO> milestoneVOList  = milestoneService.GetMilestoneList(contractMaintenanceId);

                List <MODEL.Milestone> milestoneList = new List <Milestone>();

                foreach (var item in milestoneVOList)
                {
                    milestoneList.Add(new MODEL.Milestone(item));
                }

                //get the field on with sorting needs to happen and set the
                //ordering function/delegate accordingly.
                int sortColumnIndex  = Convert.ToInt32(Request["iSortCol_0"]);
                var orderingFunction = GetMilestoneOrderingFunction(sortColumnIndex);

                var result = GetFilteredObjects(param, milestoneList, orderingFunction);
                return(result);
            }
            catch (Exception e)
            {
                return(new HttpStatusCodeAndErrorResult(500, e.Message));
            }
        }
        /// <summary>
        /// Get the list of Contract Lines based on Contract Id
        /// </summary>
        /// <param name="param"></param>
        /// <param name="contractId">Contract Id</param>
        /// <returns>ContractLine List</returns>
        public ActionResult GetContractLineByContractId(MODEL.jQueryDataTableParamModel param, int?contractId)
        {
            try
            {
                ContractLineService   contractLineService = new ContractLineService();
                List <ContractLineVO> contractLineVOList  = contractLineService.GetContractLineByContractId(contractId.Value);

                List <MODEL.ContractLine> contractLines = new List <MODEL.ContractLine>();
                foreach (var item in contractLineVOList)
                {
                    contractLines.Add(new MODEL.ContractLine(item));
                }

                ////get the field on with sorting needs to happen and set the
                ////ordering function/delegate accordingly.
                int sortColumnIndex  = Convert.ToInt32(Request["iSortCol_0"]);
                var orderingFunction = GetContractListOrderingFunction(sortColumnIndex);
                var result           = GetFilteredObjects(param, contractLines, orderingFunction);

                return(result);
            }
            catch (Exception e)
            {
                return(new HttpStatusCodeAndErrorResult(500, e.Message));
            }
        }
Exemplo n.º 14
0
        /// <summary>
        ///  Returns list of billing tags
        /// </summary>
        /// <param name="param">The filter an other parameters</param>
        /// <returns>List of billing tags</returns>
        // GET: /Administration/BillingTagList
        public ActionResult BillingTagList(MODEL.jQueryDataTableParamModel param)
        {
            try
            {
                BillingLineTagService       BillingLineTagService = new BillingLineTagService();
                List <MODEL.BillingLineTag> BillingLineTags       = new List <MODEL.BillingLineTag>();

                //Get the list of billings tag
                List <BillingLineTagVO> BillingLineTagVOList = BillingLineTagService.GetBillingLineTags();

                foreach (var BillingLineTagVO in BillingLineTagVOList)
                {
                    MODEL.BillingLineTag BillingTag = new MODEL.BillingLineTag(BillingLineTagVO);
                    BillingLineTags.Add(BillingTag);
                }

                //get the field on with sorting needs to happen and set the
                //ordering function/delegate accordingly.
                int sortColumnIndex  = Convert.ToInt32(Request["iSortCol_0"]);
                var orderingFunction = GetBillingLineTagOrderingFunction(sortColumnIndex);

                var result = GetFilteredObjects(param, BillingLineTags, orderingFunction);
                return(result);
            }
            catch (Exception e)
            {
                return(new HttpStatusCodeAndErrorResult(500, e.Message));
            }
        }
        /// <summary>
        /// Gets the list of contracts
        /// </summary>
        /// <param name="param"></param>
        /// <param name="companyId">company Id</param>
        /// <param name="invoiceCustomerId">invoice Customer id</param>
        /// <returns>List of contracts</returns>
        public ActionResult ContractList(MODEL.jQueryDataTableParamModel param, int companyId, int?invoiceCustomerId)
        {
            try
            {
                ContractService contractService = new ContractService();
                //List<ContractVO> contractVOList = contractService.GetContractList(companyId);
                List <ContractVO> contractVOList = contractService.GetContractList(companyId, invoiceCustomerId);

                List <MODEL.Contract> contracts = contractVOList.Select(item => new Models.Contract(item)).ToList();

                //get the field on with sorting needs to happen and set the
                //ordering function/delegate accordingly.
                int sortColumnIndex  = Convert.ToInt32(Request["iSortCol_0"]);
                var orderingFunction = GetContractOrderingFunction(sortColumnIndex);

                var result = GetFilteredObjects(param, contracts, orderingFunction);
                return(result);
            }
            catch (Exception exception)
            {
                return(new HttpStatusCodeAndErrorResult(500, exception.Message));
            }
        }