Exemple #1
0
        public ActionResult edite_teacher(string id)
        {
            string _id = id;
            tbl_teacher_presonal_information tb = db.tbl_teacher_presonal_information.Where(c => c.code_national_teacher == id).SingleOrDefault();
            Teacher_Repository te = new Teacher_Repository();

            te.update_teacher(tb);
            int result = db.SaveChanges();

            return(RedirectToAction("show_teacher"));
        }
Exemple #2
0
        public ActionResult action_insert_teacher(tbl_teacher_presonal_information tb)
        {
            Teacher_Repository tr = new Teacher_Repository();
            int result            = tr.insert_teacher(tb);

            if (result == 0)
            {
                return(HttpNotFound());
            }


            return(RedirectToAction("show_teacher"));
        }
Exemple #3
0
        public void insert_teacher(tbl_teacher_presonal_information tb)
        {
            Teacher_Repository tr = new Teacher_Repository();
            int result            = tr.insert_teacher(tb);

            if (result == 0)
            {
                ViewData["msg"] = "عملیات با خطا مواجه شد";
            }
            else

            {
                ViewData["msg"] = "ثبت با موفقیت انجام شد";
            }
        }
Exemple #4
0
        //public ActionResult insertAdmin(tbl_teacher_presonal_information teacher)
        //{
        //    AdminRepository ar = new AdminRepository();
        //    int result = ar.insertteacher(teacher);


        //    if (result == 0)
        //    {
        //        // خظا
        //    }
        //    else
        //    {
        //        //درست
        //    }
        //    return View();
        //}
        public void insertteacher_p_i(tbl_teacher_presonal_information teacher)
        {
            AdminRepository ar     = new AdminRepository();
            int             result = ar.insertteacher(teacher);


            if (result == 0)
            {
                // خظا
            }
            else
            {
                //درست
            }
        }
Exemple #5
0
        public ActionResult delete_teacher(string id)
        {
            tbl_teacher_presonal_information tb = db.tbl_teacher_presonal_information.Where(c => c.code_national_teacher == id).SingleOrDefault();

            db.tbl_teacher_presonal_information.Remove(tb);
            int result = db.SaveChanges();

            if (result == 0)
            {
                ViewBag.message = "failed";
            }
            else
            {
                ViewBag.message = "successful";
            }


            return(RedirectToAction("show_teacher"));
        }
Exemple #6
0
        public ActionResult Edit(string id = "")
        {
            tbl_teacher_presonal_information tb = db.tbl_teacher_presonal_information.Where(c => c.code_national_teacher == id).SingleOrDefault();

            return(View());
        }
 public int Updateteacher(tbl_teacher_presonal_information _teacher_p_i)
 {
     db.Entry(_teacher_p_i).State = System.Data.Entity.EntityState.Modified;
     return(db.SaveChanges());
 }
 public int Insertteacher(tbl_teacher_presonal_information _teacher_p_i)
 {
     db.tbl_teacher_presonal_information.Add(_teacher_p_i);
     return(db.SaveChanges());
 }
        public tbl_teacher_presonal_information FindTeacher(string code_national_teacher)
        {
            tbl_teacher_presonal_information teacher = db.tbl_teacher_presonal_information.Where(c => c.code_national_teacher == code_national_teacher).SingleOrDefault();

            return(teacher);
        }
 internal int insertteacher(tbl_teacher_presonal_information teacher)
 {
     throw new NotImplementedException();
 }
 public int Deleteteacher(tbl_teacher_presonal_information _teacher_p_i)
 {
     db.tbl_teacher_presonal_information.Remove(_teacher_p_i);
     return(db.SaveChanges());
 }