/// <summary>
 /// 
 /// </summary>
 /// <param name="student"></param>
 public void Register(Student student)
 {
     if (student!=null)
     {
         student.id = Guid.NewGuid().ToString();
         student.CreateDateTime = DateTime.Now;
         var coltn = MongoUtil.GetCollection<Student>(tableName);
         coltn.InsertOne(student);
     }
  
 }
示例#2
0
        //private IRegistrationRepository repo;

        //public RegisterController(IRegistrationRepository repo)
        //{
        //    this.repo = repo;
        //}
        // GET: Register
        public ActionResult Register()
        {
            var student = new Student();
            ViewBag.ProvinceList = ProvinceList.GetAllList().ToList();

            ViewBag.ParentStatusList = ParentStatusList.GetAllList().ToList();

            ViewBag.CourseTypeList = CourseTypeList.GetAllList().ToList();

            ViewBag.CourseYearList = CourseYearList.GetAllList().ToList();

            return View(student);
        }
示例#3
0
        public ActionResult RegisterCompleted(Student model, HttpPostedFileBase CoppyAddress, HttpPostedFileBase CopyBirth, HttpPostedFileBase StudentPic, HttpPostedFileBase ReportBook)
        {
            var CopyAddressURL = Upload(CoppyAddress);
            var CopyBirthURL = Upload(CopyBirth);
            var StudentPicURL = Upload(StudentPic);
            var ReportBookURL = Upload(ReportBook);
            model.HomeLicenseURL = CopyAddressURL;
            model.BornLicenseURL = CopyBirthURL;
            model.PicLicenseURL = StudentPicURL;
            model.StudyBookLicenseURL = ReportBookURL;


            var repo = new RegistrationRepository();
            model.SchoolId = "1";
            repo.Register(model);
            return View();
        }