コード例 #1
0
ファイル: CalendarController.cs プロジェクト: Zonxpk/NewEvent
        public ActionResult Index()
        {
            if ((string)(Session["User"]) == null || (string)(Session["Department"]) == null)
            {
                Session["url"] = "Home";
                return(RedirectToAction("Index", "Login"));
            }
            ViewData["FormProductType"] = M_Cal.GetProductType(); //Get list of product type radio
            ViewBag.Productions         = this.GetProductions();

            var DepartmentGroup = M_Detail.GetDepartmentGroup(); //Get raw group of departments
            List <DepartmentList> departmentList = new List <DepartmentList>();

            foreach (string GroupName in DepartmentGroup)
            {
                List <Department> departments = new List <Department>();
                departments = M_Detail.GetDepartmentByGroup(GroupName);
                departmentList.Add(new DepartmentList()
                {
                    Name = GroupName.Replace(" ", "_"), Department = departments
                });                                                                                                     //Convert raw group into department list for radio
            }
            ViewData["DepartmentList"] = departmentList;
            return(View());
        }
コード例 #2
0
        public ActionResult Index(string id)
        {
            if ((string)(Session["User"]) == null || (string)(Session["Department"]) == null)
            {
                Session["RedirectID"]   = id ?? null;
                Session["RedirectMode"] = "Detail";
                return(RedirectToAction("Index", "LogIn"));
            }

            Session["RedirectID"] = null;

            var DepartmentGroup = M_Detail.GetDepartmentGroup(); //Get raw group of departments
            List <DepartmentList> departmentList = new List <DepartmentList>();

            foreach (string GroupName in DepartmentGroup)
            {
                List <Department> departments = new List <Department>();
                departments = M_Detail.GetDepartmentByGroup(GroupName);
                departmentList.Add(new DepartmentList()
                {
                    Name = GroupName.Replace(" ", "_"), Department = departments
                });                                                                                                     //Convert raw group into department list for radio
            }

            ViewData["DepartmentList"] = departmentList;

            var EventDetail  = new EventDetail();
            var EventDetails = new EventDetail[2];

            EventDetail.Model = "HP1229006N0CE03";
            EventDetail.Event = "Japan";
            EventDetail.Qty   = 1;
            EventDetails[0]   = EventDetail;
            EventDetail       = new EventDetail();

            EventDetail.Model = "HP1229006N0CE03";
            EventDetail.Event = "A-MO";
            EventDetail.Qty   = 2;
            EventDetails[1]   = EventDetail;

            ViewBag.EventDetails = EventDetails;

            return(View());
        }