Exemplo n.º 1
0
        public AlarmClockViewModel()
        {
            IEnumerable <string> scoreQuery =
                from item in EnumberHelper.EnumToList <WeekEnum>()
                select item.EnumName;

            _weekList = scoreQuery.ToList();
        }
Exemplo n.º 2
0
 /// <summary>
 /// 修改公司
 /// </summary>
 /// <returns></returns>
 public ActionResult Edit(long id)
 {
     ViewBag.BusinessType  = EnumberHelper.EnumToList <BusinessTypeEnum>();
     ViewBag.Company       = CompanyService.GetByCompanyId(id);
     ViewBag.User          = UserService.GetUserList(id).FirstOrDefault();
     ViewBag.BusinessTypes = CompanyBaseDataService.GetCompanyBuninessTypeList(id).Select(x => x.ConfigName).ToList();
     return(View());
 }
Exemplo n.º 3
0
        public Page <EnumberEntity> GetCategory()
        {
            var list = EnumberHelper.EnumToList <Model.Entity.Category>();
            var page = new Page <EnumberEntity> {
                rows = list
            };

            return(page);
        }
Exemplo n.º 4
0
        /// <summary>
        /// here&more
        /// </summary>
        /// <returns></returns>
        public ActionResult HereAndMore()
        {
            Copys copys = _copysService.GetInfoAsync();

            ViewBag.Copy        = copys == null ? "" : copys.HereMoreCopy;
            ViewBag.CountryList = EnumberHelper.EnumToList <EnumCountry>();
            ViewBag.MajorList   = _majorService.GetAllAsync();
            return(View());
        }
Exemplo n.º 5
0
 /// <summary>
 /// TeacherQuestion
 /// </summary>
 /// <returns></returns>
 public ActionResult TeacherQuestion(int id = 0)
 {
     if (id == 0)
     {
         throw new Exception("导师不存在");
     }
     ViewBag.TeacherId   = id;
     ViewBag.CountryList = EnumberHelper.EnumToList <EnumCountry>();
     ViewBag.MajorList   = _majorService.GetAllAsync();
     return(View());
 }
Exemplo n.º 6
0
 /// <summary>
 /// 课程咨询
 /// </summary>
 /// <returns></returns>
 public ActionResult CourseApply(int id = 0)
 {
     if (id == 0)
     {
         throw new Exception("课程不存在");
     }
     ViewBag.CourseId    = id;
     ViewBag.CountryList = EnumberHelper.EnumToList <EnumCountry>();
     ViewBag.MajorList   = _majorService.GetAllAsync();
     return(View());
 }
Exemplo n.º 7
0
 /// <summary>
 /// 申请咨询
 /// </summary>
 /// <returns></returns>
 public ActionResult MajorApply(int id = 0, string name = null)
 {
     if (id == 0)
     {
         throw new Exception("艺术专业不存在。");
     }
     ViewBag.MajorId     = id;
     ViewBag.MajorName   = name;
     ViewBag.CountryList = EnumberHelper.EnumToList <EnumCountry>();
     ViewBag.MajorList   = _majorService.GetAllAsync();
     return(View());
 }
Exemplo n.º 8
0
        public ActionResult Index(int page = 1, int type = -1, string keyword = null)
        {
            int pageSize = 10;
            var list     = _programService.GetListAsync(page, pageSize, type, keyword);

            ViewBag.Total      = list.Total;
            ViewBag.PageIndex  = page;
            ViewBag.TotalPages = Math.Ceiling(list.Total * 1.0 / pageSize);
            ViewBag.Keyword    = keyword;
            ViewBag.Type       = type;
            ViewBag.TypeList   = EnumberHelper.EnumToList <EnumProgramType>();
            return(View(list.Data));
        }
Exemplo n.º 9
0
        /// <summary>
        /// 实习预约
        /// </summary>
        /// <returns></returns>
        public ActionResult CompanyApply(int id = 0)
        {
            if (id == 0)
            {
                throw new Exception("实习单位不存在");
            }
            ViewBag.CompanyId = id;
            Copys copys = _copysService.GetInfoAsync();

            ViewBag.Copy        = copys == null ? "" : copys.CompanyApplyCopy;
            ViewBag.CountryList = EnumberHelper.EnumToList <EnumCountry>();
            ViewBag.MajorList   = _majorService.GetAllAsync();
            return(View());
        }
Exemplo n.º 10
0
        public ActionResult Edit(int id = 0)
        {
            Teacher model  = new Teacher();
            string  action = "添加导师";

            if (id > 0)
            {
                model  = _teacherService.GetByIdAsync(id);
                action = "修改导师";
            }

            ViewBag.Action = action;

            ViewBag.TypeList = EnumberHelper.EnumToList <EnumTeacherType>();

            List <SelectListItem>  divisionList = new List <SelectListItem>();
            IEnumerable <Division> divisions    = _divisionService.GetAllAsync();

            foreach (var item in divisions)
            {
                divisionList.Add(new SelectListItem {
                    Text = item.Name, Value = item.Id.ToString()
                });
            }
            ViewBag.divisionList = divisionList;

            List <SelectListItem> schoolList = new List <SelectListItem>();
            IEnumerable <School>  schools    = _schoolService.GetAllAsync();

            foreach (var item in schools)
            {
                schoolList.Add(new SelectListItem {
                    Text = item.Name, Value = item.Id.ToString()
                });
            }
            ViewBag.SchoolList = schoolList;

            List <SelectListItem> majorList = new List <SelectListItem>();
            IEnumerable <Major>   majors    = _majorService.GetAllAsync();

            foreach (var item in majors)
            {
                majorList.Add(new SelectListItem {
                    Text = item.Name, Value = item.Id.ToString()
                });
            }
            ViewBag.MajorList = majorList;
            return(View(model));
        }
Exemplo n.º 11
0
        public ActionResult Edit(int id = 0)
        {
            School model  = new School();
            string action = "添加院校";

            if (id > 0)
            {
                model  = _schoolService.GetByIdAsync(id);
                action = "修改院校";
            }

            ViewBag.Action      = action;
            ViewBag.CountryList = EnumberHelper.EnumToList <EnumCountry>();
            return(View(model));
        }
Exemplo n.º 12
0
        /// <summary>
        /// 课程预约
        /// </summary>
        /// <returns></returns>
        public ActionResult CourseOrder(int id = 0)
        {
            if (id == 0)
            {
                throw new Exception("课程不存在");
            }
            //课程预约文案
            Copys copys = _copysService.GetInfoAsync();

            ViewBag.Copy        = copys == null ? "" : copys.CourseApplyCopy;
            ViewBag.CourseId    = id;
            ViewBag.CountryList = EnumberHelper.EnumToList <EnumCountry>();
            ViewBag.MajorList   = _majorService.GetAllAsync();
            return(View());
        }
Exemplo n.º 13
0
        public ActionResult Edit(int id = 0)
        {
            Program model  = new Program();
            string  action = "添加项目";

            if (id > 0)
            {
                model  = _programService.GetByIdAsync(id);
                action = "修改项目";
            }

            ViewBag.Action   = action;
            ViewBag.TypeList = EnumberHelper.EnumToList <EnumProgramType>();
            return(View(model));
        }
Exemplo n.º 14
0
        public ActionResult Index(int page = 1, int type = -1, int division = -1, string keyword = null)
        {
            int pageSize = 10;
            var list     = _teacherService.GetListAsync(page, pageSize, type, division, keyword);

            ViewBag.Total      = list.Total;
            ViewBag.PageIndex  = page;
            ViewBag.TotalPages = Math.Ceiling(list.Total * 1.0 / pageSize);
            ViewBag.Keyword    = keyword;
            ViewBag.type       = type;
            ViewBag.TypeList   = EnumberHelper.EnumToList <EnumTeacherType>();

            ViewBag.divisionList = _divisionService.GetAllAsync();
            ViewBag.division     = division;
            return(View(list.Data));
        }
Exemplo n.º 15
0
        public Index(int id)
        {
            InitializeComponent();

            this.start_time.Value = DateTime.Now.AddDays(-1);
            this.end_time.Value   = DateTime.Now.AddDays(1);

            this.op_type.Items.Add("全部");
            var list = EnumberHelper.EnumToList <Arthur.App.Model.OpType>();

            foreach (var obj in list)
            {
                this.op_type.Items.Add(obj.EnumName);
            }
            this.op_type.SelectedIndex = 0;
        }
Exemplo n.º 16
0
        public ActionResult Index()
        {
            //热门搜索
            IEnumerable <School> hotList = (_schoolService.GetHotListAsync(4)) ?? new List <School>();

            ViewBag.HotList = hotList;

            //专业列表
            IEnumerable <Major> majorList = (_majorService.GetAllAsync()) ?? new List <Major>();

            ViewBag.MajorList = majorList;

            ViewBag.CountryList = EnumberHelper.EnumToList <EnumCountry>();

            return(View());
        }
Exemplo n.º 17
0
        public ActionResult Edit(int id = 0)
        {
            Banner model  = new Banner();
            string action = "添加轮播";

            if (id > 0)
            {
                model  = _bannserService.GetByIdAsync(id);
                action = "修改轮播";
            }

            ViewBag.Action   = action;
            ViewBag.TypeList = EnumberHelper.EnumToList <EnumBannerType>();
            ViewBag.PosList  = EnumberHelper.EnumToList <EnumBannerPos>();
            return(View(model));
        }
Exemplo n.º 18
0
        public static MvcHtmlString SelectForEnum <TEnum>(this HtmlHelper helper, string id, string name, string @class)
        {
            var list = EnumberHelper.EnumToList <TEnum>();

            var sb = new StringBuilder();

            sb.Append($"<select id=\"{id}\" name=\"{name}\" class=\"{@class}\">");

            foreach (var item in list)
            {
                sb.Append($"<option value=\"{item.EnumValue}\">{item.Description}</option>");
            }

            sb.Append("</select>");

            return(new MvcHtmlString(sb.ToString()));
        }
Exemplo n.º 19
0
        public ActionResult Index(int page = 1, string keyword = null, int userId = 0)
        {
            int pageSize = 10;
            var list     = _logService.GetListAsync(page, pageSize, userId, keyword);

            ViewBag.Total      = list.Total;
            ViewBag.PageIndex  = page;
            ViewBag.TotalPages = Math.Ceiling(list.Total * 1.0 / pageSize);
            ViewBag.Keyword    = keyword;
            ViewBag.UserId     = userId;
            ViewBag.TypeList   = EnumberHelper.EnumToList <EnumOperType>();

            var users = _userService.GetListAsync(1, 100);

            ViewBag.UserList = users.Data;

            return(View(list.Data));
        }
Exemplo n.º 20
0
        public ActionResult Index(int page = 1, string keyword = null, int pos = -1, int type = -1)
        {
            int pageSize = 10;
            var list     = _bannserService.GetListAsync(page, pageSize, keyword, pos, type);

            ViewBag.Total      = list.Total;
            ViewBag.PageIndex  = page;
            ViewBag.TotalPages = Math.Ceiling(list.Total * 1.0 / pageSize);
            ViewBag.Keyword    = keyword;

            ViewBag.TypeList = EnumberHelper.EnumToList <EnumBannerType>();
            ViewBag.PosList  = EnumberHelper.EnumToList <EnumBannerPos>();

            ViewBag.Type = type;
            ViewBag.Pos  = pos;

            return(View(list.Data));
        }
Exemplo n.º 21
0
        public Edit(int id)
        {
            InitializeComponent();
            this.TrayScaner  = Current.TrayScaners.FirstOrDefault(o => o.Id == id);
            this.DataContext = this.TrayScaner;

            //  var list = EnumberHelper.EnumToList<Arthur.App.Model.OpType>();
            var ports = SerialPort.GetPortNames().ToList();

            ports.ForEach(o => { this.portname.Items.Add(o); });
            this.portname.SelectedIndex = ports.IndexOf(this.TrayScaner.PortName);

            var baudrates = new List <int>()
            {
                1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200
            };

            baudrates.ForEach(o => { this.baudrate.Items.Add(o); });
            this.baudrate.SelectedIndex = baudrates.IndexOf(this.TrayScaner.BaudRate);

            var databits = new List <int>()
            {
                6, 7, 8
            };

            databits.ForEach(o => { this.databits.Items.Add(o); });
            this.databits.SelectedIndex = databits.IndexOf(this.TrayScaner.DataBits);

            var paritys = EnumberHelper.EnumToList <Parity>();

            paritys.ForEach(o => { this.parity.Items.Add(o.EnumName); });
            this.parity.SelectedIndex = this.parity.Items.IndexOf(this.TrayScaner.Parity.ToString());

            var stopbits = EnumberHelper.EnumToList <StopBits>();

            stopbits.ForEach(o => { this.stopbits.Items.Add(o.EnumName); });
            this.stopbits.SelectedIndex = this.stopbits.Items.IndexOf(this.TrayScaner.StopBits.ToString());
        }
Exemplo n.º 22
0
 /// <summary>
 /// 添加公司
 /// </summary>
 /// <returns></returns>
 public ActionResult Create()
 {
     ViewBag.BusinessType = EnumberHelper.EnumToList <BusinessTypeEnum>();
     return(View());
 }
Exemplo n.º 23
0
 /// <summary>
 /// WorksComment
 /// </summary>
 /// <returns></returns>
 public ActionResult WorksComment()
 {
     ViewBag.CountryList = EnumberHelper.EnumToList <EnumCountry>();
     ViewBag.MajorList   = _majorService.GetAllAsync();
     return(View());
 }
Exemplo n.º 24
0
        /// <summary>
        ///     返回成功结果
        /// </summary>
        /// <param name="message">结果信息</param>
        /// <returns></returns>
        public static BaseResponse Ok(string message = null)
        {
            var code = BusinessStatusType.OK;

            return(GetBaseResponse(code, message ?? EnumberHelper.GetEnumDescription(code)));
        }
Exemplo n.º 25
0
 public BaseResponse(BusinessStatusType code)
 {
     Code    = (int)code;
     Message = EnumberHelper.GetEnumDescription(code);
 }