예제 #1
0
        public ActionResult Log(DoctorSign doctorSign)
        {
            try
            {
                IBL bl = new BlClass();
                Dictionary <string, string> errorMessege = bl.SignValidation(doctorSign);
                if (errorMessege.Count == 1)
                {
                    if (doctorSign.email == "*****@*****.**" && doctorSign.password == "מנהל")
                    {
                        RouteConfig.IsManager = true;
                        return(View("~/Views/Home/Index.cshtml"));
                    }

                    bl.SignIn(doctorSign);
                    Doctor doctor = bl.GetDoctors(doc => doc.email == doctorSign.email).FirstOrDefault();
                    RouteConfig.doctor = doctor;
                    return(View("~/Views/Home/Index.cshtml"));
                }

                foreach (var item in errorMessege)
                {
                    ModelState.AddModelError(item.Key, item.Value);
                }
                ViewBag.SigndivActive = "true";
                return(View("LogIn"));
            }
            catch (System.Exception ex)
            {
                ViewBag.TitlePopUp    = "שגיאה";
                ViewBag.Message       = ex.Message;
                ViewBag.SigndivActive = "true";
                return(View("LogIn"));
            }
        }
예제 #2
0
        public DoctorModel()
        {
            BlClass bL = new BlClass();

            doctors = bL.GetDoctors();
        }