Ejemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            msStaff msStaff = db.msStaffs.Find(id);

            msStaff.status          = 0;
            msStaff.modified_date   = DateTime.Now;
            msStaff.modified_by     = "Fikri Adriansyah";
            db.Entry(msStaff).State = EntityState.Modified;
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "id_staff,nama_staff,jenis_kelamin,no_ktp,tempat_lahir,tanggal_lahir,alamat,no_telp,pendidikan_terakhir,tahun_masuk,username,password,role,status,created_date,created_by,modified_date,modified_by")] msStaff msStaff)
 {
     if (ModelState.IsValid)
     {
         msStaff.status          = 1;
         msStaff.modified_date   = DateTime.Now;
         msStaff.modified_by     = "Fikri Adriansyah";
         db.Entry(msStaff).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(msStaff));
 }
Ejemplo n.º 3
0
        // GET: msStaffs/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            msStaff msStaff = db.msStaffs.Find(id);

            if (msStaff == null)
            {
                return(HttpNotFound());
            }
            return(View(msStaff));
        }
Ejemplo n.º 4
0
 public ActionResult LoginStaff(msStaff staff)
 {
     if (ModelState.IsValid)
     {
         using (danasuraEntities db = new danasuraEntities())
         {
             var obj = db.msStaffs.Where(x => x.username == staff.username && x.password == staff.password).FirstOrDefault();
             if (obj != null)
             {
                 Session["id"]   = obj.id_staff.ToString();
                 Session["nama"] = obj.nama_staff.ToString();
                 //return RedirectToAction("DonaturMenu");
                 return(View("~/Views/msStaffs/Details.cshtml", obj));
             }
         }
     }
     return(View(staff));
 }