コード例 #1
0
        public ActionResult Dashboard()
        {
            #region variabels
            string         strTmp       = null;
            string         getAction_ID = null;
            string         getAction    = null;
            string         UserPending  = null;
            List <int>     roleidlist   = new List <int>();
            List <RoleMap> RoleMapList  = new List <RoleMap>();
            #endregion

            #region Session variable
            int CustId     = Convert.ToInt32(Session["Cust_ID"]);
            int UserToRole = Convert.ToInt16(Session["SortedList1"]);
            int Userrole   = Convert.ToInt16(Session["U_ID"]);
            #endregion

            #region Objects
            RoleAction         RoletoAction = new RoleAction();
            BirthProcessAction objDB        = new BirthProcessAction();
            BirthProcess       Bprocess     = new BirthProcess();
            #endregion

            RoletoAction.ShowRolltoAction = objDB.GetTbl_Action_MasterId(Userrole, 1);
            Session["RoleDesc"]           = objDB.roleDesc;

            if (RoletoAction.ShowRolltoAction.Count == 0)
            {
                UserPending = objDB.GetAllUsersPending(Userrole);
                return(View("Dummy"));
            }

            UserPending = objDB.GetAllUsersPending(Userrole);

            TempData["Viewstr"] = strTmp;

            #region Differentiate Each role to Action
            foreach (RoleAction ActionRole in RoletoAction.ShowRolltoAction)
            {
                if (UserToRole == ActionRole.RoleId)
                {
                    getAction_ID = ActionRole.ActionId.ToString();
                    getAction_ID = getAction_ID.Trim();
                    getAction    = ActionRole.ActionDesc;
                }
            }
            #endregion

            Bprocess.ShowallBirthRegis = objDB.CountPending(getAction_ID, getAction, CustId);
            Session["ActionId"]        = getAction_ID;
            Session["ActionName"]      = getAction;
            Session["CustomerID"]      = CustId;


            ActionID_Name = getAction + "|" + getAction_ID;
            if (Bprocess.ShowallBirthRegis == null)
            {
                return(View("Dummy"));
            }

            return(View(Bprocess));
        }