Ejemplo n.º 1
0
        public ActionResult Delete(DoctortypeModel N)
        {
            var d = db.tblDoctorTypes.SingleOrDefault(x => x.intTypeId == N.TypeId);

            db.tblDoctorTypes.Remove(d);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
0
        public ActionResult Delete(int?id)
        {
            tblDoctorType   D = db.tblDoctorTypes.SingleOrDefault(x => x.intTypeId == id);
            DoctortypeModel N = new DoctortypeModel()
            {
                TypeId = D.intTypeId,
                Type   = D.strType,
            };

            return(View(N));
        }
Ejemplo n.º 3
0
        public ActionResult Create(DoctortypeModel D)
        {
            tblDoctorType dt = new tblDoctorType();

            dt.intTypeId = D.TypeId;
            dt.strType   = D.Type;

            db.tblDoctorTypes.Add(dt);
            db.SaveChanges();

            return(RedirectToAction("Index"));
        }
Ejemplo n.º 4
0
        public ActionResult Index()
        {
            var dblist = db.tblDoctorTypes.ToList();
            List <DoctortypeModel> list = new List <DoctortypeModel>();

            foreach (tblDoctorType D in dblist)
            {
                DoctortypeModel dt = new DoctortypeModel();
                dt.TypeId = D.intTypeId;
                dt.Type   = D.strType;
                list.Add(dt);
            }
            return(View(list));
        }
Ejemplo n.º 5
0
        public ActionResult Edit(DoctortypeModel dt)
        {
            tblDoctorType d = db.tblDoctorTypes.SingleOrDefault(x => x.intTypeId == dt.TypeId);


            if (d != null)
            {
                d.intTypeId = dt.TypeId;
                d.strType   = dt.Type;



                db.SaveChanges();
            }
            return(RedirectToAction("Index"));
        }