Exemple #1
0
        public async Task StudentRecord()
        {
            ulong         sID    = Context.User.Id;
            string        sc     = StudentCode.GetStudentCode(sID);
            StudentRecord record = await student.ReadDatum(sID);

            IDMChannel dmc = await Context.User.GetOrCreateDMChannelAsync();

            await dmc.SendMessageAsync($"학번: {sc}\n" +
                                       $"이름: {record.Name}\n" +
                                       $"기숙사: {record.Dormitory}\n" +
                                       $"학급: {record.Grade}\n" +
                                       $"입학일: {record.JoinedDate}");
        }
        string GetStudentShortName()
        {
            string[] ele  = StudentName.Trim().Split(new char[] { ' ' });
            int      size = ele.Length;

            string remain = "";

            for (int i = 0; i < size - 1; i++)
            {
                remain += ele[i][0];
            }
            remain = remain.ToUpper();

            return(convertToUnSign3(ele[size - 1] + remain + StudentCode.ToUpper()));
        }
Exemple #3
0
 /// <summary>
 /// 获取分页列表
 /// </summary>
 /// <param name="pageIndex">页码</param>
 /// <param name="pageSize">分页大小</param>
 /// <param name="name">名称 - 搜索项</param>
 /// <param name="no">编号 - 搜索项</param>
 /// <returns></returns>
 public ActionResult GetPageList(int pageIndex,
                                 int pageSize,
                                 string name,
                                 string referenceId,
                                 string no,
                                 string mobile,
                                 string enteredPointId,
                                 string makeDriverShopId,
                                 string wantDriverShopId,
                                 int moneyIsFull,
                                 int isOnSchool,
                                 int orderBy,
                                 StudentCode state,
                                 DateTime?enteredTimeStart, DateTime?enteredTimeEnd,
                                 DateTime?makedTimeStart, DateTime?makeTimeEnd)
 {
     return(JResult(WebService.Get_StudentPageList(pageIndex, pageSize, name, referenceId, no, mobile, enteredPointId, makeDriverShopId, wantDriverShopId, state, moneyIsFull, isOnSchool, orderBy, enteredTimeStart, enteredTimeEnd, makedTimeStart, makeTimeEnd)));
 }
Exemple #4
0
        /// <summary>
        /// 导出获取分页列表
        /// </summary>
        /// <param name="pageIndex">页码</param>
        /// <param name="pageSize">分页大小</param>
        /// <param name="name">名称 - 搜索项</param>
        /// <param name="no">编号 - 搜索项</param>
        /// <returns></returns>
        public ActionResult ExportPageList(int pageIndex,
                                           int pageSize,
                                           string name,
                                           string referenceId,
                                           string no,
                                           string mobile,
                                           string enteredPointId,
                                           string makeDriverShopId,
                                           StudentCode state,
                                           int orderBy,
                                           DateTime?enteredTimeStart, DateTime?enteredTimeEnd,
                                           DateTime?makedTimeStart, DateTime?makeTimeEnd,
                                           bool isAll = false)
        {
            var    list     = WebService.Export_StudentPageList(pageIndex, pageSize, name, referenceId, no, mobile, enteredPointId, makeDriverShopId, state, orderBy, enteredTimeStart, enteredTimeEnd, makedTimeStart, makeTimeEnd, isAll);
            string fileName = DateTime.Now.ToString("yyyyMMddhhmmss") + ".xls";
            string filePath = Path.Combine(Server.MapPath("~/") + @"Export\" + fileName);

            NPOIHelper <StudentExportModel> .GetExcel(list, GetHT(), filePath);

            //Directory.Delete(filePath);
            return(File(filePath, "application/vnd.ms-excel", fileName));
        }
        public ActionResult SubmitCode(StudentSignUpModel m)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    StudentCode c = new StudentCode();
                    c.Code=m.code;
                    if (!c.IsValid())
                    { throw new Exception("Invalid Code."); }

                    //enable below code to disallow returning logins.
                    //if (c.IsClaimed())
                    //{ throw new Exception("This code has already been used to sign up."); }

                    Musical cm = Musical.CurrentMusical();

                    if (DateTime.Today.Date > cm.signupEndDate)
                    {
                        throw new Exception(cm.expiredMessage);
                    }

                    if (DateTime.Today.Date < cm.signupStartDate)
                    {
                        throw new Exception("The sign up period has not yet started. Please check back on " + ((DateTime)cm.signupStartDate).ToString("MM/dd/yyyy") + ".");
                    }

                    return RedirectToRoute("StudentInfo", new { code = c.Code });
                }
                else
                {
                    return View("SignUp", m.code);
                }
            }
            catch (Exception ex)
            {
                ModelState.AddModelError("", ex.Message);
                return View("SignUp", m);
            }
        }