Beispiel #1
0
        public ActionResult PostDoctorEdit(DoctorModel model)
        {
            CommonData cmodel = new CommonData();

            using (ProjectEntities1 db = new ProjectEntities1())
            {
                int memid = Convert.ToInt32(Session["MemberId"]);
                var gdata = db.Doctors.FirstOrDefault(a => a.MemberId == memid);
                model.doctorlst = cmodel.DoctorSpecs();
                MemberModel m = new MemberModel();
                if (gdata != null)
                {
                    db.UpdateDoctor(memid, model.FirstName, model.LastName, model.TotalExperience
                                    , model.SpecializedId, model.Gender);


                    ViewBag.message = "Profile Updated !";
                    return(View("DoctorEdit", model));
                }
                else
                {
                    db.InsertDoctor(memid, model.FirstName, model.LastName, model.TotalExperience
                                    , model.SpecializedId, model.Gender);

                    ViewBag.message = "Profile Saved !";
                    return(View("DoctorEdit", model));

                    /*  }
                     * else
                     * {
                     *    return View("DoctorEdit", model);
                     * }*/
                }
            }
        }