Example #1
0
        public async Task <ActionResult> Listing()
        {
            string queryPage = HttpContext.Request.Query["page"];
            int    page      = 1;

            if (queryPage != null)
            {
                page = Convert.ToInt32(queryPage);
            }
            var  Company_Id     = HttpContext.Session.GetString("Company_Id");
            var  User_Id        = HttpContext.Session.GetString("User_Id");
            var  userRoles      = JsonConvert.DeserializeObject <List <VmRoleItem> >(HttpContext.Session.GetString("SelectedRoles"));
            bool isCompanyAdmin = false;

            if (userRoles.Where(e => e.Id == Constants.C_Admin_Role).ToList().Count > 0)
            {
                isCompanyAdmin = true;
            }

            var result = await quotationService.GetQuotationByPage(Convert.ToInt32(User_Id), Convert.ToInt32(Company_Id), page, 10, isCompanyAdmin);

            return(View(result));
        }