Ejemplo n.º 1
0
        public ActionResult AddNew()
        {
            var model = new ViewModels.BookViewModel();

            //model.LanguageCode = "DK";
            SetupAvailableLanguages(model);
            return(View(model));
        }
Ejemplo n.º 2
0
        public ActionResult AddNew(ViewModels.BookViewModel model)
        {
            SetupAvailableLanguages(model);

            if (string.IsNullOrEmpty(model.Title))
            {
                return(View(model));
            }


            ///Save to database
            model.IsSaved = true;
            return(View(model));

            //return View(model);
        }
Ejemplo n.º 3
0
 void SetupAvailableLanguages(ViewModels.BookViewModel model)
 {
     model.AvailableLanguages = new List <SelectListItem>
     {
         new SelectListItem {
             Value = null, Text = "..välj ett språk.."
         },
         new SelectListItem {
             Value = "SE", Text = "Svenska"
         },
         new SelectListItem {
             Value = "FI", Text = "Finska"
         },
         new SelectListItem {
             Value = "DK", Text = "Danska"
         },
     };
 }
Ejemplo n.º 4
0
 public ActionResult Index2(ViewModels.BookViewModel apt)
 {
     ClinicalELDAL.EntityLayer.Appointment appointment = new ClinicalELDAL.EntityLayer.Appointment();
     prt = new ClinicalELDAL.Repository.PatientRepository();
     if (ModelState.IsValid)
     {
         appointment.PatientUserID = Convert.ToInt32(Session["UserID"]);
         appointment.DoctorUserID  = apt.DoctorUserID;
         appointment.Date          = apt.Date;
         appointment.Status        = "inactive";
         appointment.Time          = apt.Time;
         bool b = prt.AddApppointment(appointment);
         if (b == true)
         {
             return(RedirectToAction("Index"));
         }
         else
         {
             return(RedirectToAction("AddAppointment"));
         }
     }
     ViewModels.BookViewModel aptobj = new ViewModels.BookViewModel();
     return(View(aptobj));
 }
Ejemplo n.º 5
0
 public ActionResult Index2()
 {
     ViewModels.BookViewModel vp = new ViewModels.BookViewModel();
     return(View(vp));
 }