Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="container-fluid">
- <div class="row">
- <div class="jumbotron jumbotron-fluid">
- <div class="container">
- <h1 class="display-4">ÖĞRENCİ DÜZENLEME SAYFASI</h1>
- <p class="lead">Bu ekrandan öğrenci bilgilerini düzenleyebilirsiniz.</p>
- </div>
- </div>
- <div class="btn btn-light">
- @Html.ActionLink(" Öğrenci Listesine Geri Dön", "Index", null, new { @class = "btn btn-warning fa fa-list" })
- </div>
- @using (Html.BeginForm("Edit", "Student", FormMethod.Post, new { enctype = "multipart/form-data" }))
- {
- @Html.AntiForgeryToken()
- @Html.ValidationSummary(true, "", new { @class = "text-danger" })
- @Html.HiddenFor(model => model.Id)
- <hr />
- <div class="col-md-5">
- <div class="form-group">
- <label>ALAN</label>
- <div class="input-group">
- <span class="input-group-addon"><i class="fa fa-graduation-cap"></i></span>
- @Html.EditorFor(model => model.Type, new { htmlAttributes = new { @class = "form-control" } })
- </div>
- <small class="form-text text-muted">Öğrenci Alanını Giriniz. Örneğin; Sayısal, Sözel</small>
- @Html.ValidationMessageFor(model => model.Type, "", new { @class = "text-danger" })
- </div>
- <div class="form-group">
- <label>SINIF</label>
- <div class="input-group">
- <span class="input-group-addon"><i class="fa fa-users"></i></span>
- @Html.DropDownList("Class_Id", null, htmlAttributes: new { @class = "form-control" })
- </div>
- <small class="form-text text-muted">Öğrenci Sınıfını Seçiniz</small>
- @Html.ValidationMessageFor(model => model.Class_Id, "", new { @class = "text-danger" })
- </div>
- <div class="form-group">
- <label>GRUP</label>
- <div class="input-group">
- <span class="input-group-addon"><i class="fa fa-indent"></i></span>
- @Html.DropDownList("Group_Id", null, htmlAttributes: new { @class = "form-control" })
- </div>
- <small class="form-text text-muted">Öğrenci hazırlandığı sınav türünü seçiniz</small>
- @Html.ValidationMessageFor(model => model.Group_Id, "", new { @class = "text-danger" })
- </div>
- <div class="form-group">
- <label>TC NUMARASI</label>
- <div class="input-group">
- <span class="input-group-addon"><i class="fa fa-id-card-o"></i></span>
- @Html.EditorFor(model => model.TCno, new { htmlAttributes = new { @class = "form-control" } })
- </div>
- <small class="form-text text-muted">Öğrenci TC Kimlik numarası giriniz</small>
- @Html.ValidationMessageFor(model => model.TCno, "", new { @class = "text-danger" })
- </div>
- <div class="form-group">
- <label>AD</label>
- <div class="input-group">
- <span class="input-group-addon"><i class="fa fa-font"></i></span>
- @Html.EditorFor(model => model.FName, new { htmlAttributes = new { @class = "form-control" } })
- </div>
- <small class="form-text text-muted">Öğrenci Ad</small>
- @Html.ValidationMessageFor(model => model.FName, "", new { @class = "text-danger" })
- </div>
- <div class="form-group">
- <label>SOYAD</label>
- <div class="input-group">
- <span class="input-group-addon"><i class="fa fa-strikethrough"></i></span>
- @Html.EditorFor(model => model.LName, new { htmlAttributes = new { @class = "form-control" } })
- </div>
- <small class="form-text text-muted">Öğrenci Soyadı Giriniz</small>
- @Html.ValidationMessageFor(model => model.LName, "", new { @class = "text-danger" })
- </div>
- <div class="form-group">
- <label>CİNSİYET</label>
- <div class="input-group">
- <span class="input-group-addon"><i class="fa fa-intersex"></i></span>
- <table>
- <tr>
- <td>@Html.RadioButtonFor(model => model.Gender, true) <strong>Bay</strong></td>
- <td> </td>
- <td>@Html.RadioButtonFor(model => model.Gender, false) <strong>Bayan</strong></td>
- </tr>
- </table>
- </div>
- <small class="form-text text-muted">Öğrenci Cinsiyeti seçiniz</small>
- @Html.ValidationMessageFor(model => model.Gender, "", new { @class = "text-danger" })
- </div>
- <div class="form-group">
- <label>DOĞUM TARİHİ</label>
- <div class="input-group">
- <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
- @Html.EditorFor(model => model.Birthday, new { htmlAttributes = new { @class = "form-control" } })
- </div>
- <small class="form-text text-muted">Öğrenci Doğum Tarihi</small>
- @Html.ValidationMessageFor(model => model.Birthday, "", new { @class = "text-danger" })
- </div>
- <div class="form-group">
- <label>ÖĞRENCİ TELEFON</label>
- <div class="input-group">
- <span class="input-group-addon"><i class="fa fa-phone"></i></span>
- @Html.EditorFor(model => model.Phone, new { htmlAttributes = new { @class = "form-control" } })
- </div>
- <small class="form-text text-muted">Öğrenci Mobil telefon numarası giriniz. Ör: 05xx xxx xxxx</small>
- @Html.ValidationMessageFor(model => model.Phone, "", new { @class = "text-danger" })
- </div>
- <div class="form-group">
- <label>DURUM</label>
- <div class="input-group">
- <span class="input-group-addon"><i class="fa fa-toggle-on"></i></span>
- <table>
- <tr>
- <td>@Html.RadioButtonFor(model => model.Status, true) <strong>Aktif</strong></td>
- <td> </td>
- <td>@Html.RadioButtonFor(model => model.Status, false) <strong>Pasif</strong></td>
- </tr>
- </table>
- </div>
- <small class="form-text text-muted">Öğrenci Durumunu seçiniz</small>
- @Html.ValidationMessageFor(model => model.Status, "", new { @class = "text-danger" })
- </div>
- <div class="form-group">
- <label>FOTOĞRAF</label>
- <div class="input-group">
- <img src="@Url.Content(Session["Image"].ToString())" height="100" width="100" />
- <br />
- <input type="file" class="custom-file-input" value="Dosya Seç..." name="ImageFile">
- </div>
- <small class="form-text text-muted">Öğrenci fotoğrafı seçiniz. 1 MB küçük |.png|.jpg|.jpeg uzantılı dosyayı seçiniz.</small>
- @Html.ValidationMessageFor(model => model.Photo, "", new { @class = "text-danger" })
- </div>
- </div>
- <div class="col-md-1"></div>
- <div class="col-md-5">
- <div class="form-group">
- <label>E-POSTA</label>
- <div class="input-group">
- <span class="input-group-addon"><i class="fa fa-envelope"></i></span>
- @Html.EditorFor(model => model.eMail, new { htmlAttributes = new { @class = "form-control" } })
- </div>
- <small class="form-text text-muted">Öğrenci Sisteme giriş yapabilmesi için bir E-Posta adresi giriniz.</small>
- @Html.ValidationMessageFor(model => model.eMail, "", new { @class = "text-danger" })
- </div>
- <div class="form-group">
- <label>ŞİFRE</label>
- <div class="input-group">
- <span class="input-group-addon"><i class="fa fa-key"></i></span>
- @Html.EditorFor(model => model.Password, new { htmlAttributes = new { @class = "form-control" } })
- </div>
- <small class="form-text text-muted">Öğrenci Sisteme giriş yapabilmesi için bir şifre giriniz.</small>
- @Html.ValidationMessageFor(model => model.Password, "", new { @class = "text-danger" })
- </div>
- <div class="form-group">
- <label>KATILMA TARİHİ</label>
- <div class="input-group">
- <span class="input-group-addon"><i class="fa fa-check-circle-o"></i></span>
- @Html.EditorFor(model => model.DateOfJoin, new { htmlAttributes = new { @class = "form-control" } })
- </div>
- <small class="form-text text-muted">Öğrenci Katılma tarihini giriniz.</small>
- @Html.ValidationMessageFor(model => model.DateOfJoin, "", new { @class = "text-danger" })
- </div>
- <div class="form-group">
- <label>AYRILMA TARİHİ</label>
- <div class="input-group">
- <span class="input-group-addon"><i class="fa fa-circle-o"></i></span>
- @Html.EditorFor(model => model.DateOfLeave, new { htmlAttributes = new { @class = "form-control" } })
- </div>
- <small class="form-text text-muted">Öğrenci Ayrılma tarihini seçiniz.</small>
- </div>
- <div class="form-group">
- <label>ADRES</label>
- <div class="input-group">
- <span class="input-group-addon"><i class="fa fa-map-marker"></i></span>
- @Html.TextAreaFor(model => model.Address, new { @class = "form-control", @style = "height: 100px" })
- </div>
- <small class="form-text text-muted">Öğrenci Adres'ini giriniz.</small>
- @Html.ValidationMessageFor(model => model.Address, "", new { @class = "text-danger" })
- </div>
- <div class="form-group">
- <label>VELİ AD</label>
- <div class="input-group">
- <span class="input-group-addon"><i class="fa fa-id-badge"></i></span>
- @Html.EditorFor(model => model.ParentName, new { htmlAttributes = new { @class = "form-control" } })
- </div>
- <small class="form-text text-muted">Öğrenci'nin Veli adını giriniz.</small>
- @Html.ValidationMessageFor(model => model.ParentName, "", new { @class = "text-danger" })
- </div>
- <div class="form-group">
- <label>VELİ TELEFON 1</label>
- <div class="input-group">
- <span class="input-group-addon"><i class="fa fa-mobile"></i></span>
- @Html.EditorFor(model => model.ParentPhone1, new { htmlAttributes = new { @class = "form-control" } })
- </div>
- <small class="form-text text-muted">Öğrenci'nin Veli Telefon numarasını giriniz.</small>
- @Html.ValidationMessageFor(model => model.ParentPhone1, "", new { @class = "text-danger" })
- </div>
- <div class="form-group">
- <label>VELİ TELEFON 2</label>
- <div class="input-group">
- <span class="input-group-addon"><i class="fa fa-phone"></i></span>
- @Html.EditorFor(model => model.ParentPhone2, new { htmlAttributes = new { @class = "form-control" } })
- </div>
- <small class="form-text text-muted">Öğrenci'nin Veli yedek telefon numarasını giriniz.</small>
- </div>
- <div class="form-group">
- <label>VELİ CİNSİYET</label>
- <div class="input-group">
- <span class="input-group-addon"><i class="fa fa-intersex"></i></span>
- <table>
- <tr>
- <td>@Html.RadioButtonFor(model => model.ParentGender, true) <strong>Bay</strong></td>
- <td> </td>
- <td>@Html.RadioButtonFor(model => model.ParentGender, false) <strong>Bayan</strong></td>
- </tr>
- </table>
- </div>
- <small class="form-text text-muted">Veli'nin cinsiyetini seçiniz.</small>
- @Html.ValidationMessageFor(model => model.ParentGender, "", new { @class = "text-danger" })
- </div>
- <div class="form-group">
- <label>AÇIKLAMA</label>
- <div class="input-group">
- <span class="input-group-addon"><i class="fa fa-align-justify"></i></span>
- @Html.TextAreaFor(model => model.Description, new { @class = "form-control", @style = "height: 100px" })
- </div>
- <small class="form-text text-muted">Öğrenci için bir açıklama giriniz.</small>
- @Html.ValidationMessageFor(model => model.Description, "", new { @class = "text-danger" })
- </div>
- </div>
- <div class="col-md-1"></div>
- <br />
- <br />
- <div class="form-group">
- <div class="col-md-12">
- <button type="submit" class="btn btn-success ">
- <i class="fa fa-floppy-o"> Değişiklikleri Kaydet</i>
- </button>
- </div>
- </div>
- <br />
- <br />
- }
- </div>
- private DBClassroomEntities db = new DBClassroomEntities();
- / GET: Student/Edit/5
- public ActionResult Edit(int? id)
- {
- if (id == null)
- {
- return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
- }
- var student = db.Students.Find(id);
- if (student == null)
- {
- return HttpNotFound();
- }
- ViewBag.Class_Id = new SelectList(db.Classes, "ID", "Name", student.Class_Id);
- ViewBag.Group_Id = new SelectList(db.Groups, "ID", "Name", student.Group_Id);
- return View(student);
- }
- [HttpPost]
- [ValidateAntiForgeryToken]
- public ActionResult Edit(Student student)
- { //does not enter here because I can't see the old data in Student.
- if (ModelState.IsValid)
- {
- db.Entry(student).State = EntityState.Modified;
- db.SaveChanges();
- return RedirectToAction("Index");
- }
- ViewBag.Class_Id = new SelectList(db.Classes, "ID", "Name", student.Class_Id);
- ViewBag.Group_Id = new SelectList(db.Groups, "ID", "Name", student.Group_Id);
- return View(student);
- }
- public partial class Student
- {
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
- public Student()
- {
- this.Discontinuities = new HashSet<Discontinuity>();
- this.Grades = new HashSet<Grade>();
- this.Payments = new HashSet<Payment>();
- }
- public int Id { get; set; }
- public string Type { get; set; }
- public Nullable<int> Class_Id { get; set; }
- public Nullable<int> Group_Id { get; set; }
- public string TCno { get; set; }
- public string FName { get; set; }
- public string LName { get; set; }
- public bool Gender { get; set; }
- public Nullable<System.DateTime> Birthday { get; set; }
- public string Phone { get; set; }
- public string eMail { get; set; }
- public string Password { get; set; }
- public bool Status { get; set; }
- public Nullable<System.DateTime> DateOfJoin { get; set; }
- public Nullable<System.DateTime> DateOfLeave { get; set; }
- public string Address { get; set; }
- public string ParentName { get; set; }
- public string ParentPhone1 { get; set; }
- public string ParentPhone2 { get; set; }
- public bool ParentGender { get; set; }
- public string Photo { get; set; }
- public string Description { get; set; }
- //public HttpPostedFileBase filex { get; set; }
- public virtual Class Class { get; set; }
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
- public virtual ICollection<Discontinuity> Discontinuities { get; set; }
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
- public virtual ICollection<Grade> Grades { get; set; }
- public virtual Group Group { get; set; }
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
- public virtual ICollection<Payment> Payments { get; set; }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement