Esempio n. 1
0
        public ActionResult Med(string Prefix)
        {
            Bal_MedicineDetails    BL  = new Bal_MedicineDetails();
            MedicineDetails        MD  = new MedicineDetails();
            List <MedicineDetails> lst = new List <MedicineDetails>();

            AdminDetails admObj = (AdminDetails)Session["UserDetails"];

            MD = BL.ViewAllMedicine(admObj.HospitalId);
            //lst = MD.lst;
            lst = MD.lst.Where(x => x.MedicineName.ToUpper().Contains(Prefix.ToUpper())).ToList();
            return(Json(lst, JsonRequestBehavior.AllowGet));
        }
        public ActionResult Login(AdminDetails AD)
        {
            AdminDetails ad = new AdminDetails();

            ad = BP.GetLoginUserDetails(AD);
            // ----setting -------
            Bal_MedicineDetails BLs = new Bal_MedicineDetails();
            Settings            s   = new Settings();

            s = BLs.GetSettings(ad.UserId);


            Session["ActivationFor"]    = ad.ActivationFor;
            Session["User"]             = ad;
            Session["Language"]         = s.Language;
            Session["VitalInformation"] = s.VitalInformation;
            Session["Complaints"]       = s.Complaints;
            Session["Test"]             = s.Test;
            Session["Diagnosis"]        = s.Diagnosis;
            Session["Medication"]       = s.Medication;
            Session["Observation"]      = s.Observation;
            Session["NextVisit"]        = s.NextVisit;
            Session["Printer"]          = s.Printer;
            Session["Template"]         = s.Template;
            Session["Advice"]           = s.Advice;
            //-------------
            Session["date"] = DateTime.Now.ToString("dd/MM/yyyy");
            DayOfWeek wk = DateTime.Today.DayOfWeek;

            Session["wkday"]             = wk.ToString();
            Session["RoleId"]            = ad.RoleId;
            Session["Msg"]               = "0";
            Session["DivViewAllPatient"] = "true";
            if (ad.UserId.ToString() != null && ad.UserId != 0)
            {
                if (ad.HospClinicLogo == "")
                {
                    Session["LOGO"] = "/img/avatar-1.jpg";
                }
                else
                {
                    Session["LOGO"] = ad.HospClinicLogo;
                }
                Session["UserDetails"] = ad;
                Session["name"]        = ad.FirstName;
                Session["degree"]      = ad.Education;
                Session["regNo"]       = ad.RegNumber;
                //Session["specality"] = ad.Speciality;
                Session["Hid"]   = ad.HospitalId;
                Session["Hname"] = ad.HostClincName;
                // Session["Speciality"] = ad.Speciality;
                if (string.IsNullOrEmpty(Session["specality"] as string))
                {
                    Session["specality"] = " ";
                }
                else
                {
                    Session["specality"] = ad.Speciality;
                }


                Session["Haddress"]  = ad.HospClinicAddess;
                Session["Hnumber"]   = ad.WhatsAppNumber;
                Session["HinTime1"]  = ad.FirmInTime1;
                Session["HoutTime1"] = ad.FirmOutTime1;
                Session["HinTime2"]  = ad.FirmInTime2;
                Session["HoutTime2"] = ad.FirmOutTime2;
                //-----Doctor Count------
                if (ad.DrCount == null)
                {
                    Session["DrCount"] = "";
                }
                else
                {
                    Session["DrCount"] = ad.DrCount;
                }

                if (string.IsNullOrEmpty(Session["HinTime1"] as string))
                {
                    Session["HinTime1"] = " ";
                }

                if (string.IsNullOrEmpty(Session["HoutTime1"] as string))
                {
                    Session["HoutTime1"] = " ";
                }

                if (string.IsNullOrEmpty(Session["HinTime2"] as string))
                {
                    Session["HinTime2"] = " ";
                }
                else
                {
                    string str = Session["HinTime2"].ToString();
                    str = " & " + str + "";
                    Session["HinTime2"] = str;
                }
                if (string.IsNullOrEmpty(Session["HoutTime2"] as string))
                {
                    Session["HoutTime2"] = " ";
                }
                else
                {
                    string str2 = Session["HoutTime2"].ToString();
                    str2 = " - " + str2 + "";
                    Session["HoutTime2"] = str2;
                }
                Session["Holiday"] = ad.Holiday;
                if (string.IsNullOrEmpty(Session["Holiday"] as string))
                {
                    Session["Holiday"] = "Non";
                }
                //Session["Photo"] = ad.HospClinicLogo;
                Session["Id"] = ad.UserId;
                FormsAuthentication.SetAuthCookie(AD.WhatsAppNumber, AD.RememberMe);
                return(RedirectToAction("GetQueueList", "PatientDetails"));
                // return RedirectToAction("ViewAllPatient", "PatientDetails");
            }
            TempData["notice"] = "Invalid username and password";
            return(View("LoginDetails"));
        }