コード例 #1
0
        //
        // GET: /UserInstitute/Create

        public ActionResult Create()
        {
            decimal?USER_NO = null;

            List <SEC_USERS> user_list = db.SEC_USERS.Where(a => a.USER_TYPE_NO == 5).ToList();

            ViewBag.user_list = user_list;
            ViewBag.USER_NO   = new SelectList(user_list, "USER_NO", "USER_NAME");

            if ((user_list != null) && (user_list.Count > 0))
            {
                USER_NO = user_list.FirstOrDefault().USER_NO;
            }

            ViewBag.INST_TYPE_NO = new SelectList(db.SET_INST_TYPE, "INST_TYPE_NO", "INST_TYPE_NAME");

            List <SET_ZILLA> zilla_list = db.SET_ZILLA.OrderBy(a => a.ZILLA_NAME).ToList();

            ViewBag.ZILLA_NO = new SelectList(zilla_list, "ZILLA_NO", "ZILLA_NAME");

            decimal ZILLA_NO = zilla_list.FirstOrDefault().ZILLA_NO;

            List <SET_THANA> thana_list = db.SET_THANA.Where(a => a.ZILLA_NO == ZILLA_NO).OrderBy(a => a.THANA_NAME).ToList();

            ViewBag.THANA_NO = new SelectList(thana_list, "THANA_NO", "THANA_NAME");

            //ViewBag.INSTITUTE_NO = new SelectList(db.SET_INSTITUTE, "INSTITUTE_NO", "LAST_ACTION");

            var institute_list = db.SEC_USER_INSTITUTE_SEARCH(null, USER_NO, null, null).ToList();

            ViewBag.institute_list = institute_list;

            return(View());
        }