Exemplo n.º 1
0
 public ActionResult StudentDetail(string studentId)
 {
     this.init();
     JxLib.StudentController studentController = new JxLib.StudentController();
     System.Collections.Hashtable item = studentController.getUserByStudentId(studentId);
     ViewData["item"] = item;
     ViewData["open_menu"] = "驾校管理";
     return View();
 }
Exemplo n.º 2
0
 public ActionResult StudentList(int page = 1)
 {
     this.init();
     JxLib.StudentController studentController = new JxLib.StudentController();
     List<System.Collections.Hashtable> list = studentController.getBySchool();
     ViewData["list"] = list;
     ViewData["open_menu"] = "驾校管理";
     return View();
 }
Exemplo n.º 3
0
 public ActionResult StudentCoupon(string id)
 {
     this.init();
     JxLib.StudentController studentController = new JxLib.StudentController();
     System.Collections.Hashtable item = studentController.load(id);
     ViewData["item"] = item;
     ViewData["title"] = "发放优惠卷";
     ViewData["open_menu"] = "驾校管理";
     return View();
 }
Exemplo n.º 4
0
        private string addStudent(Models.Student stu)
        {
            JxLib.StudentController studentController = new JxLib.StudentController();
            SystemConfigureLib.SerialNumberController serialContrller = new SystemConfigureLib.SerialNumberController();

            System.Collections.Hashtable item = studentController.getUserByOpenId(stu.openid);

            if (item != null)
            {
                return item["StudentID"].ToString();
            }

            string student_id = serialContrller.getSerialNumberRand("stu", DateTime.Now.ToString("yyyy-MM-dd"));

            System.Collections.Hashtable data = new System.Collections.Hashtable();

            data.Add("NickName", CommonLib.Common.Validate.filterEmoji(stu.nickname));
            data.Add("OpenId", stu.openid);
            data.Add("HeadPic", stu.headimgurl);
            data.Add("Sex", stu.sex);
            data.Add("StudentID", student_id);

            string strText = studentController.add(data);

            if (studentController.Result)
                return student_id;
            else
                return null;
        }
Exemplo n.º 5
0
        public ActionResult StudentEnterSave()
        {
            JxLib.StudentController studentController = new JxLib.StudentController();
            DatabaseLib.Tools tools = new DatabaseLib.Tools();
            CacheLib.Cookie cookie = new CacheLib.Cookie();

            string strParam = Request.Form.ToString();

            System.Collections.Hashtable data = tools.paramToData(strParam);

            string user_id = cookie.GetCookie("user_id");
            //深大驾校测试代码
            data.Add("SchoolID", "1");
            //data.Add("StudentID", "00001");
            data.Add("StudentID", user_id);

            data.Add("EnterDate", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));

            studentController.save(data);

            studentController.saveEnter(data);

            if (studentController.Result)
            {
                return RedirectToRoute("enter-success");
            }
            else
            {
                return RedirectToRoute("home");
            }
        }
Exemplo n.º 6
0
        public ActionResult RegUser()
        {
            string code = this.HttpContext.Request.QueryString["code"];
            string tmp_web_url = this.HttpContext.Request.QueryString["web_url"];

            string web_url = System.Web.HttpUtility.UrlDecode(tmp_web_url);

            if (CommonLib.Common.Validate.IsNullString(web_url) != "")
            {
                if (web_url == "http://wx.yune-jia.com/")
                {
                    web_url = "/";
                }
                else
                {
                    web_url = web_url.Replace("http://wx.yune-jia.com/", "/");
                }
            }
            else
            {
                web_url = "/";
            }

            string open_id = this.getOpenId(code);

            Models.Student stu = this.getUserInfo(open_id);

            string student_id = this.addStudent(stu);

            if (student_id == null)
                ViewData["data"] = "用户注册失败!";
            else
            {
                JxLib.StudentController studentController = new JxLib.StudentController();
                JxLib.CouponController couponController = new JxLib.CouponController();

                System.Collections.Hashtable item = studentController.load(student_id);

                //System.Collections.Hashtable coupon = new System.Collections.Hashtable();

                //coupon.Add("CouponText", "98元学车体验券");
                //coupon.Add("Amount", "98");
                //coupon.Add("Password", "");
                //coupon.Add("StudentID", student_id);
                //coupon.Add("CreateAt", DateTime.Now.ToString("yyyy-MM-dd"));
                //coupon.Add("ModifyAt", DateTime.Now.ToString("yyyy-MM-dd"));

                //couponController.add(coupon);

                if (item["SchoolID"].ToString() == "")
                {
                    System.Collections.Hashtable coupon1 = new System.Collections.Hashtable();

                    coupon1.Add("CouponText", "300元学车券");
                    coupon1.Add("Amount", "300");
                    coupon1.Add("Password", couponController.getPassword());
                    coupon1.Add("StudentID", student_id);
                    coupon1.Add("CreateAt", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                    coupon1.Add("ModifyAt", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));

                    couponController.add(coupon1);
                }

                CacheLib.Cookie cookie = new CacheLib.Cookie();

                cookie.AddCookie("user_id", student_id);

                ViewData["data"] = student_id;
                ViewData["url"] = web_url;
            }

            return View();
        }
Exemplo n.º 7
0
        public ActionResult MyIndex()
        {
            JxLib.StudentController studentController = new JxLib.StudentController();
            CacheLib.Cookie cookie = new CacheLib.Cookie();

            string user_id = cookie.GetCookie("user_id");

            ViewData["data"] = studentController.load(user_id);
            ViewData["user_id"] = user_id;
            ViewData["title"] = "我的首页";

            return View();
        }