Exemplo n.º 1
0
 public ActionResult Edit(Teacher teacher)
 {
     if (ModelState.IsValid)
     {
         db.Entry(teacher).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index")); //编辑成功,跳转到查询页面
     }
     ViewBag.Teacher = teacher;             //将查询的数据返回视图
     return(View());
 }
Exemplo n.º 2
0
 public ActionResult Edit(Dict dict)
 {
     if (ModelState.IsValid)
     {
         db.Entry(dict).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));//编辑成功,跳转到查询页面
     }
     ViewBag.Dict = dict;
     return(View());
 }
Exemplo n.º 3
0
 public ActionResult Edit([Bind(Include = "ID,Company_ID,Name,URL,Type,Desc,Num,InterNum")] Post post)
 {
     if (ModelState.IsValid)
     {
         db.Entry(post).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Types       = new SelectList(db.Dict.Where(d => d.TypeName == "岗位类型"), "Value", "Name");
     ViewBag.Company_IDs = new SelectList(db.Company, "ID", "Title", post.Company_ID);
     return(View(post));
 }
Exemplo n.º 4
0
 public ActionResult Edit([Bind(Include = "ID,Title,City,URL,Desc,InterTime,StopTime,InterType,Statu,Creator")] Company company)
 {
     if (ModelState.IsValid)
     {
         db.Entry(company).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.InterTypes = new SelectList(db.Dict.Where(d => d.TypeName == "面试形式"), "Value", "Name");
     ViewBag.Status     = new SelectList(db.Dict.Where(d => d.TypeName == "招聘状态"), "Value", "Name");
     ViewBag.Creator    = new SelectList(db.Teacher, "ID", "Name", company.Creator);
     return(View(company));
 }
Exemplo n.º 5
0
 public ActionResult Edit(Grade grade)
 {
     if (ModelState.IsValid)
     {
         db.Entry(grade).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));//编辑成功,跳转到查询页面
     }
     ViewBag.Grade        = grade;
     ViewBag.Professions  = new SelectList(db.Dict.Where(d => d.TypeName == "专业"), "Value", "Name", grade.Profession);
     ViewBag.MProfessions = new SelectList(db.Dict.Where(d => d.TypeName == "MHYS共建专业"), "Value", "Name", grade.MProfession);
     ViewBag.Counsellors  = new SelectList(db.Teacher.Where(t => t.Roles == "辅导员"), "ID", "Name", grade.Counsellor); //辅导员列表
     ViewBag.Lecturers    = new SelectList(db.Teacher.Where(t => t.Roles == "技术顾问"), "ID", "Name", grade.Lecturer);  //技术顾问列表
     return(View());
 }
Exemplo n.º 6
0
 public ActionResult Edit([Bind(Include = "ID,Title,Content,Attachment,CreateTime,Creator")] Notice notice, HttpPostedFileBase file)
 {
     if (ModelState.IsValid)
     {
         if (file != null && file.ContentLength != 0)
         {
             notice.Attachment = "~/Upload/Notice/" + file.FileName;
             file.SaveAs(Server.MapPath(notice.Attachment));//保存到服务器(上传该附件)
         }
         db.Entry(notice).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Creator = new SelectList(db.Teacher, "ID", "Name", notice.Creator);
     return(View(notice));
 }