Exemple #1
0
        // GET: Liveboard
        public ActionResult Index([Bind(Include = "SelectedMode,SelectedCapdo,SelectedGiaTriCapDo,SelectedCongDoan")] FilterCoditionModel FilterCodition)
        {
            var CurrentUser = Session["Username"] as BI_USER;

            if (CurrentUser == null)
            {
                return(RedirectToAction("Index", "Login"));
            }

            string strResult = String.Empty;

            using (TKTDSXEntities dc = new TKTDSXEntities())
            {
                CommonModel cm = new CommonModel();

                try
                {
                    //get user login
                    FilterCodition.MANDT = CurrentUser.MANDT;
                    FilterCodition.SYSID = CurrentUser.SYSID;

                    //add mode view


                    //get data of current date
                    FilterCodition.DateFrom = DateTime.Now;
                    FilterCodition.DateTo   = DateTime.Now;

                    strResult                   = cm.GetPhanQuyen(ref FilterCodition, CurrentUser.Username);
                    ViewBag.SelectedCapDo       = FilterCodition.ListCapDo;
                    ViewBag.SelectedGiaTriCapDo = FilterCodition.ListGiaTriCapDo;
                    ViewBag.GiatriCapDo         = FilterCodition.SelectedGiaTriCapDo;

                    //lay danh sach cong doan
                    cm.GetCongDoanAll(ref FilterCodition);

                    ViewBag.SelectedCongDoan = FilterCodition.ListCongDoan;

                    cm.getModeView(ref FilterCodition);
                    ViewBag.SelectedMode = FilterCodition.ListModeView;

                    return(View("Index", FilterCodition));
                }
                catch (Exception ex)
                {
                    ViewBag.MessagePQ = "Chưa được cấp quyền" + ex.Message;
                    return(View());
                }
            }
        }