Exemplo n.º 1
0
        void Scedulle()
        {
            saveBtn.ServerClick += delegate
            {
                var appTable = new Appointment();
                List <Symptom_dataset> keywords_Tables = new Symptom_dataset().getAllRecords();
                pairs = new Dictionary <string, int>();

                foreach (var words in keywords_Tables)
                {
                    List <string> MyDocList = new List <string>();
                    var           txtArray  = words.Symptom.Replace(",", "").Split();
                    for (int i = 0; i < txtArray.Length; i++)
                    {
                        MyDocList.Add(txtArray[i]);
                    }
                    var docType = new Speciality_table().Load_record_with(Speciality_table_support.Column.Speciality, Speciality_table_support.LogicalOperator.EQUAL_TO, words.Speciality);
                    dictionary.Add(docType.Speciality, MyDocList);
                }

                schedule.GetDoctorsFromDb(dictionary, messageBox.Value, out List <string> doc);

                DataTable table = shiftHandler.GetTable(doc, true);
                Session["description"] = messageBox.Value;
                Session["table"]       = table;
                Response.Redirect(nav.PatientHome);
            };
        }
Exemplo n.º 2
0
        private void LoadData(string id)
        {
            id = enc.DecryptString(id, SV.LoginKey);
            var uDetails = new User_details(id);

            fname.InnerText   = uDetails.Fname.ToUpper();
            lname.InnerText   = uDetails.Lname.ToUpper();
            NameLiteral.Text  = new User_details_view().Load_record_with(User_details_view_support.Column.Id, User_details_view_support.LogicalOperator.EQUAL_TO, id).Name;
            dob.InnerText     = DateTime.Parse(uDetails.Dob).ToLongDateString();
            contact.InnerText = uDetails.Contact;
            userTpe.InnerHtml = uDetails.User_type.ToUpper();
            var s = new Speciality_table().Load_record_with(Speciality_table_support.Column.Doctor_id, Speciality_table_support.LogicalOperator.EQUAL_TO, uDetails.User_id).Speciality;

            speciality.InnerText = !string.IsNullOrEmpty(s) ? s.ToUpper() : "N/A";
            DisplayShift(id);
            var prof = SV.GetImage(new Profile_image_table().Load_record_with(Profile_image_table_support.Column.User_id, Profile_image_table_support.LogicalOperator.EQUAL_TO, id).Url);

            ProfPicLiteral.Text = $"<img src='../../images/{SV.GetImage(prof)}' alt='' class='img-responsive' />";
        }
Exemplo n.º 3
0
        public Dictionary <int, List <List <string> > > SetShift(Dictionary <int, List <List <string> > > shiftDictionary, string docId)
        {
            var docType = new Speciality_table().Load_record_with(Speciality_table_support.Column.Doctor_id, Speciality_table_support.LogicalOperator.EQUAL_TO, docId);

            var cus = from s in shiftDictionary where s.Value[0][0] == "MON" select s.Key;
            var n   = cus.ToString();

            foreach (var day in shiftDictionary)
            {//int max = day.Value.Max(a => a.Count);
                //var newList = period.Intersect(DaysOfWeek).ToList();
                var matchingIdValues = day.Value.FirstOrDefault(stringToCheck => stringToCheck.Contains(docId));
                if (matchingIdValues == null)
                {
                    random = new Random();
                    int tempRandValue = random.Next(1, 6), pos = 0;
                    int max = day.Value.Max(a => a.Count);
                    foreach (var period in day.Value)
                    {
                        pos++;
                        var checkList = period.Intersect(DaysOfWeek).ToList();
                        if (checkList.Count == 0)
                        {
                            continue;
                        }
                        if (pos == tempRandValue)
                        {
                            for (int i = 0; i < period.Count; i++)
                            {
                                var docTempType = new Speciality_table().Load_record_with(Speciality_table_support.Column.Doctor_id, Speciality_table_support.LogicalOperator.EQUAL_TO, period[i]);
                                if (docTempType.Speciality != docType.Speciality)
                                {
                                    period.Add(docId);
                                }
                                //break;
                            }
                        }
                    }
                }
            }
            return(shiftDictionary);
        }
Exemplo n.º 4
0
        private void SaveDoctor()
        {
            SaveBtn.ServerClick += delegate
            {
                var redirect = string.Empty;
                var logins   = new Login_table().Load_record_with(Login_table_support.Column.Username, Login_table_support.LogicalOperator.EQUAL_TO, userBox.Value);
                if (IsEmpty(logins.Id))
                {
                    var uDetails = new User_details();
                    var spTable  = new Speciality_table();
                    if (passBox.Value == rePass.Value)
                    {
                        logins.insert(userBox.Value, enc.GetMD5(enc.StrongEncrypt(passBox.Value)), DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), "3");
                        uDetails.insert(logins.Id, Session["fname"].ToString(), Session["lname"].ToString(), Session["email"].ToString(), Session["address"].ToString(),
                                        Session["contact"].ToString(), Session["gender"].ToString(), Session["date"].ToString(), "doctor");
                        ImagePofile();
                        spTable.insert(logins.Id, Session["profession"].ToString());

                        new ShiftHandler().SetDocShift(logins.Id);

                        Session["message"] = elements.GetMesage("New doctor has been added :-)", HtmlElements.MessageType.SUCCESS, HtmlElements.UserType.MANAGEMENT);
                        Shift    = new Shift(SV.ShiftFilePath, logins.Id);
                        redirect = nav.Dashboard;
                    }
                    else
                    {
                        Session["message"] = elements.GetMesage("Passwords do not match!", HtmlElements.MessageType.SUCCESS, HtmlElements.UserType.MANAGEMENT); redirect = nav.ManNewDoctorDetails;
                    }
                }
                else
                {
                    Session["message"] = elements.GetMesage("Username already exist", HtmlElements.MessageType.SUCCESS, HtmlElements.UserType.MANAGEMENT); redirect = nav.ManNewDoctorDetails;
                }
                Response.Redirect(redirect);
            };
        }