Example #1
0
        public IActionResult Print(int id)
        {
            IndexPrep();
            var    dt = new DataTable();
            string sp = "sp_KanbanReport";
            List <SqlParameter> param = new List <SqlParameter>();

            param.Add(new SqlParameter("@kanbanReqId", id));
            param.Add(new SqlParameter("@userId", LoginInfo.UserId));
            dt = SqlHelp.ExecQuery(sp, param);
            List <vKanbanRequest> viewlist = SqlHelp.ConvertToList <vKanbanRequest>(dt);

            vKanbanRequest vKanban = new vKanbanRequest();
            EKanbanReport  model   = new EKanbanReport();

            if (viewlist != null && viewlist.Count != 0)
            {
                vKanban = viewlist[0];
                model.vKanbanRequest = vKanban;

                //item list
                sp    = "sp_KanbanReportItem";
                param = new List <SqlParameter>();
                param.Add(new SqlParameter("@kanbanReqId", id));
                dt = SqlHelp.ExecQuery(sp, param);
                List <EKanbanReportItem> itemlist = SqlHelp.ConvertToList <EKanbanReportItem>(dt);
                model.ItemList = itemlist;
            }
            else
            {
                return(NotFound());
            }

            return(View(model));
        }
Example #2
0
        protected void GetMenu()
        {
            string sp = "sp_GetUserMenu";
            List <SqlParameter> param = new List <SqlParameter>
            {
                new SqlParameter("@roleId", LoginInfo.RoleId)
            };
            DataTable            dt       = SqlHelp.ExecQuery(sp, param);
            List <MenuViewModel> menuList = SqlHelp.ConvertToList <MenuViewModel>(dt);

            ViewBag.MenuList = menuList;
        }