コード例 #1
0
ファイル: StayController.cs プロジェクト: thep497/TormorWeb
        //
        // GET: /Stay/Stay/
        public ActionResult Index(int?dtpSelectRange, DateTime?dtpFromDate, DateTime?dtpToDate)
        {
            ToolbarMenuHelpers.SetToolBar(ViewData, new { New = "Insert", Date = "Index" }, "Stay",
                                          null, null, ref dtpSelectRange, ref dtpFromDate, ref dtpToDate);

            return(View(stayRepo.FindAll(dtpFromDate, dtpToDate).ToList()));
        }
コード例 #2
0
        private ActionResult doInsert(VisaDetail visa)
        {
            ToolbarMenuHelpers.SetToolBar(ViewData,
                                          new { Save = "btnSave", New = "Insert", Close = "Index2" }, "Visa");

            //makeReferenceViewData();
            return(View(visa));
        }
コード例 #3
0
        private ActionResult doInsert(ReEntry reentry)
        {
            ToolbarMenuHelpers.SetToolBar(ViewData,
                                          new { Save = "btnSave", New = "Insert", Close = "Index2" }, "ReEntry");

            //makeReferenceViewData();
            return(View(reentry));
        }
コード例 #4
0
        private ActionResult doInsert(Endorse endorse)
        {
            ToolbarMenuHelpers.SetToolBar(ViewData,
                                          new { Save = "btnSave", New = "Insert", Close = "Index2" }, "Endorse");

            //makeReferenceViewData();
            return(View(endorse));
        }
コード例 #5
0
        private ActionResult doInsert(ConveyanceInOut convInOut)
        {
            ToolbarMenuHelpers.SetToolBar(ViewData,
                                          new { Save = "btnSave", New = "Insert", Close = "Index2" }, "ConveyanceInOut");

            //makeReferenceViewData();
            convInOut.Code = convInOutRepo.GetNewCode();
            return(View(convInOut));
        }
コード例 #6
0
ファイル: StayController.cs プロジェクト: thep497/TormorWeb
        private ActionResult doInsert(Staying90Day stay)
        {
            ToolbarMenuHelpers.SetToolBar(ViewData,
                                          new { Save = "btnSave", New = "Insert", Close = "Index2" }, "Stay");

            //makeReferenceViewData();
            stay.Code = stayRepo.GetNewCode();
            return(View(stay));
        }
コード例 #7
0
        private ActionResult doInsert(AddRemoveCrew addRemoveCrew, int addRemoveType)
        {
            ToolbarMenuHelpers.SetToolBar(ViewData,
                                          new { Save = "btnSave", New = "Insert", Close = "Index2" }, "AddRemoveCrew", new { addRemoveType });

            //makeReferenceViewData();
            ViewData["AddRemoveType"] = addRemoveType;
            return(View(addRemoveCrew));
        }
コード例 #8
0
        public ViewResult Index(bool?isShowRow)
        {
            ToolbarMenuHelpers.SetToolBar(ViewData, new { New = "Register" }, "Account", new { area = "" });

            return(View(new IndexViewModel
            {
                Users = _userService.FindAll(0, 100000),
                Roles = _rolesService.FindAll(),
                IsShowRow = isShowRow ?? false
            }));
        }
コード例 #9
0
        private ActionResult doEdit(AddRemoveCrew addRemoveCrew, int addRemoveType, bool?backToSearch = null)
        {
            ToolbarMenuHelpers.SetToolBar(ViewData,
                                          new { Save = "btnSave", New = "Insert", GiveUp = "btnDelete", Close = "Index2" }, "AddRemoveCrew", new { addRemoveType, backToSearch });

            ViewData["AddRemoveType"] = addRemoveType;
            if (addRemoveCrew != null)
            {
                return(View(addRemoveCrew));
            }
            else
            {
                TempData.AddError(Resources.Messages.NotFoundData);
                return(RedirectToAction("Index2", new { addRemoveType }));
            }
        }
コード例 #10
0
        //
        // GET: /Search/Search/

        public ActionResult Index()
        {
            if (searchRepo.AlienSearch == null)
            {
                searchRepo.AlienSearch = new AlienSearchInfo(Globals.WantVisa, Globals.WantReEntry, Globals.WantEndorse, Globals.WantStay, Globals.WantShip);
            }

            int?     dtpSelectRange = searchRepo.AlienSearch.dtpSelectRange;
            DateTime?dtpFromDate    = searchRepo.AlienSearch.dtpFromDate;
            DateTime?dtpToDate      = searchRepo.AlienSearch.dtpToDate;

            ToolbarMenuHelpers.SetToolBar(ViewData,
                                          new
            {
                Print  = "AlienListReport",
                Print1 = "AlienListReport",
                Print2 = "AlienListReportXLS",
                Print3 = "AlienDetailReport",
                Date   = "Index",
                New    = "#",  //ใส่กรณีที่มี submenu แต่ไม่ต้องการให้มี action กระทำการใด ๆ
                New1   = "Visa/Visa/Insert",
                New2   = "Visa/ReEntry/Insert",
                New3   = "Visa/Endorse/Insert",
                New4   = "Visa/Stay/Insert"
            },
                                          "Search",
                                          null,
                                          new
            {
                Print1 = "พิมพ์รายการติดต่อบุคคลต่างด้าว",
                Print2 = "พิมพ์รายการติดต่อบุคคลต่างด้าว (Excel)",
                Print3 = "พิมพ์รายละเอียดบุคคลต่างด้าว",
                New1   = "เพิ่มรายการขอต่ออายุ",
                New2   = "เพิ่มรายการ Re-Entry",
                New3   = "เพิ่มรายการสลักหลังถิ่นที่อยู่",
                New4   = "เพิ่มรายการรายงานตัว 90 วัน"
            }, ref dtpSelectRange, ref dtpFromDate, ref dtpToDate);

            //ไม่ต้องใส่ค่ากลับให้ dtpSelectRange เพราะในนั้นมัน set เป็น 0
            searchRepo.AlienSearch.dtpFromDate = dtpFromDate;
            searchRepo.AlienSearch.dtpToDate   = dtpToDate;

            var searchData = new AlienSearchViewModel(searchRepo.AlienSearch,
                                                      aTranRepo.FindAll(searchRepo.AlienSearch).ToList());

            return(View(searchData));
        }
コード例 #11
0
        public ActionResult Index(int addRemoveType, int?dtpSelectRange, DateTime?dtpFromDate, DateTime?dtpToDate)
        {
            ToolbarMenuHelpers.SetToolBar(ViewData,
                                          new
            {
                New  = "Insert",
                Date = "Index"
            },
                                          "AddRemoveCrew",
                                          new { addRemoveType },
                                          null,
                                          ref dtpSelectRange,
                                          ref dtpFromDate, ref dtpToDate);

            ViewData["AddRemoveType"] = addRemoveType;
            return(View(addRemoveCrewRepo.FindAll(addRemoveType, dtpFromDate, dtpToDate).ToList()));
        }
コード例 #12
0
        private ActionResult doEdit(ConveyanceInOut convInOut, bool?backToSearch = null)
        {
            ToolbarMenuHelpers.SetToolBar(ViewData,
                                          new { Save = "btnSave", New = "Insert", GiveUp = "btnDelete", Close = "Index2" }, "ConveyanceInOut", new { backToSearch });

            //ส่งผ่านตัวแปรเพื่อทำ combobox
            //makeReferenceViewData();

            if (convInOut != null)
            {
                return(View(convInOut));
            }
            else
            {
                TempData.AddError(Resources.Messages.NotFoundData);
                return(RedirectToAction("Index2"));
            }
        }
コード例 #13
0
ファイル: StayController.cs プロジェクト: thep497/TormorWeb
        private ActionResult doEdit(Staying90Day stay)
        {
            ToolbarMenuHelpers.SetToolBar(ViewData,
                                          new { Save = "btnSave", New = "Insert", GiveUp = "btnDelete", Close = "Index2" }, "Stay");

            //ส่งผ่านตัวแปรเพื่อทำ combobox
            //makeReferenceViewData();

            if (stay != null)
            {
                return(View(stay));
            }
            else
            {
                TempData.AddError(Resources.Messages.NotFoundData);
                return(RedirectToAction("Index2"));
            }
        }
コード例 #14
0
        public ActionResult Index(int?refTypeId)
        {
            if (refTypeId == null)
            {
                return(View("Blank"));
            }

            //the grid called... 2?Grid-mode=insert
            ToolbarMenuHelpers.SetToolBar(ViewData, new { New = "Index" }, "Reference",
                                          new RouteValueDictionary {
                { "Grid-mode", "insert" }, { "refTypeId", refTypeId }
            }, null, true);

            ReferenceViewModel refVM = new ReferenceViewModel(refRepo, refTypeId ?? 0);

            populateReferences(refTypeId ?? 0);
            return(View("Index", refVM));
        }
コード例 #15
0
        //
        // GET: /Visa/

        public ActionResult Index(int?dtpSelectRange, DateTime?dtpFromDate, DateTime?dtpToDate)
        {
            ToolbarMenuHelpers.SetToolBar(ViewData,
                                          new
            {
                //Save = "Save", //กรณีปุ่ม Save/GiveUp ให้ link ไปที่ id ของปุ่ม save จริง ๆ ของฟอร์ม
                New = "Insert",
                //GiveUp = "Delete",
                //Print = "Print",
                //Print1 = "Print",
                //Other = "Other",
                //Other1 = "Other",
                Date = "Index"
            },
                                          "Visa",
                                          null,
                                          null, //new { Other1 = "อื่น ๆ ลองดู", },
                                          ref dtpSelectRange,
                                          ref dtpFromDate, ref dtpToDate);

            return(View(visaRepo.FindAll(dtpFromDate, dtpToDate).ToList()));
        }
コード例 #16
0
        //
        // GET: /ConveyanceInOut/ConveyanceInOut/
        public ActionResult Index()
        {
            if (searchRepo.ConveyanceSearch == null)
            {
                searchRepo.ConveyanceSearch = new ConveyanceSearchInfo();
            }

            int?     dtpSelectRange = searchRepo.ConveyanceSearch.dtpSelectRange;
            DateTime?dtpFromDate    = searchRepo.ConveyanceSearch.dtpFromDate;
            DateTime?dtpToDate      = searchRepo.ConveyanceSearch.dtpToDate;

            ToolbarMenuHelpers.SetToolBar(ViewData, new { New = "Insert", Date = "Index" }, "ConveyanceInOut",
                                          null, null, ref dtpSelectRange, ref dtpFromDate, ref dtpToDate);

            //ไม่ต้องใส่ค่ากลับให้ dtpSelectRange เพราะในนั้นมัน set เป็น 0
            searchRepo.ConveyanceSearch.dtpFromDate = dtpFromDate;
            searchRepo.ConveyanceSearch.dtpToDate   = dtpToDate;

            var searchData = new ConveyanceSearchViewModel(searchRepo.ConveyanceSearch,
                                                           convInOutRepo.FindAll(searchRepo.ConveyanceSearch).ToList());

            return(View(searchData));
        }