Beispiel #1
0
        private void Login(object o)
        {
            DatabaseContext dbContext  = new DatabaseContext();
            User            loggedUser = dbContext.Users.FirstOrDefault(user => user.Username == Username && user.Password == Password);

            if (loggedUser == null)
            {
                Debug.WriteLine("User not found");
                return;
            }

            if (loggedUser.Type == "admin")
            {
                DoctorsView doctorsView = new DoctorsView();
                doctorsView.Show();
                InterventionsView interventionsView = new InterventionsView();
                interventionsView.Show();
            }
            else
            {
                DoctorMenuView doctorView = new DoctorMenuView();
                doctorView.Show();
            }

            Application.Current.Windows.OfType <LoginView>().First().Close();//sau hide , dunno
        }
Beispiel #2
0
        public void ShowDoctorsView()
        {
            var vm   = new DoctorsViewModel(this);
            var from = new DoctorsView(vm);

            from.Owner = _mainfrom;
            from.ShowDialog();
        }
Beispiel #3
0
        /* protected void ExportToExcelClick(object sender, EventArgs e)
         * {
         *   Response.ClearContent();
         *   Response.Buffer = true;
         *   Response.AppendHeader("content-disposition", "attachment; filename=DoctorsList.xls");
         *   Response.ContentType = "application/excel";
         *   StringWriter sw = new StringWriter();
         *   HtmlTextWriter htw = new HtmlTextWriter(sw);
         *   DoctorsView.AllowPaging = false;
         *
         *   DoctorsView.HeaderRow.ControlStyle.Font.Size = 25;
         *   DoctorsView.HeaderRow.Style.Add("background-color", "red");
         *   for (int i=0; i< DoctorsView.HeaderRow.Cells.Count; i++)
         *   {
         *       DoctorsView.HeaderRow.Cells[i].ColumnSpan =2;
         *       DoctorsView.ForeColor = System.Drawing.Color.Blue;
         *   }
         *   for (int i = 0; i < DoctorsView.Rows.Count; i++)
         *   {
         *       for (int j = 0; j < DoctorsView.Rows[i].Cells.Count; j++)
         *       {
         *           DoctorsView.Rows[i].Cells[j].Style.Add("background-color", "yellow");
         *           DoctorsView.Rows[i].Cells[j].ColumnSpan = 2;
         *           DoctorsView.Rows[i].Cells[j].ForeColor = System.Drawing.Color.Blue;
         *           DoctorsView.ForeColor = System.Drawing.Color.Blue;
         *       }
         *
         *   }
         *
         *   DoctorsView.RenderControl(htw);
         *   string headerTable = @"<Table><tr><td align='center' colspan='16' rowspan='2' style='font-size:20px;'><b>HEALTH BRIDGE REPORT</b></td></tr></Table>";
         *   Response.Write(headerTable);
         *   Response.Write(sw.ToString());
         *   Response.End();
         *
         *
         * }*/



        public void loadData()
        {
            try
            {
                sqlcon.Open();
                MySqlDataAdapter adp = new MySqlDataAdapter("Select HospitalId, HospitalName, DoctorName, Specialization, HospitalLocation,HospitalAddress, Rating,ConsultancyFee from health_bridge_doctors", sqlcon);
                DataSet          ds  = new DataSet();
                adp.Fill(ds);

                DoctorsView.DataSource = ds;
                DoctorsView.DataBind();
            }
            catch (Exception ex)
            {
                Response.Write("problem with Connection" + ex);
            }
            finally
            {
                sqlcon.Close();
            }
        }
Beispiel #4
0
        public void GetFilterData()
        {
            if (cities.SelectedIndex != 0 && specialization.SelectedIndex != 0)
            {
                ViewState["queryStr"] = "Select HospitalId, HospitalName, DoctorName, Specialization, HospitalLocation,HospitalAddress, Rating,ConsultancyFee from health_bridge_doctors where HospitalLocation='" + cities.SelectedValue + "' AND Specialization='" + specialization.SelectedValue + "'";
            }
            else if (cities.SelectedIndex != 0 && specialization.SelectedIndex == 0)
            {
                ViewState["queryStr"] = "Select HospitalId, HospitalName, DoctorName, Specialization, HospitalLocation,HospitalAddress, Rating,ConsultancyFee from health_bridge_doctors where HospitalLocation='" + cities.SelectedValue + "'";
            }
            else if (cities.SelectedIndex == 0 && specialization.SelectedIndex != 0)
            {
                ViewState["queryStr"] = "Select HospitalId, HospitalName, DoctorName, Specialization, HospitalLocation,HospitalAddress, Rating,ConsultancyFee from health_bridge_doctors where  Specialization='" + specialization.SelectedValue + "'";
            }
            else if (cities.SelectedIndex == 0 && specialization.SelectedIndex == 0)
            {
                ViewState["queryStr"] = "Select HospitalId, HospitalName, DoctorName, Specialization, HospitalLocation,HospitalAddress, Rating,ConsultancyFee from health_bridge_doctors where HospitalLocation='" + cities.SelectedValue + "' AND Specialization='" + specialization.SelectedValue + "'";
            }
            // ShowMessage(ViewState["cityName"].ToString() +" ->"+flag+ " Record Successfully Inserted", MessageType.success);
            try
            {
                sqlcon.Open();
                MySqlDataAdapter adp = new MySqlDataAdapter(ViewState["queryStr"].ToString(), sqlcon);

                DataSet ds = new DataSet();
                adp.Fill(ds);

                DoctorsView.DataSource = ds;
                DoctorsView.DataBind();
            }
            catch (Exception ex)
            {
                Response.Write("problem with Connection" + ex);
            }
            finally
            {
                sqlcon.Close();
            }
        }
 public DoctorsViewModel(DoctorsView doctorsView)
 {
     this.doctorsView = doctorsView;
     DoctorList       = doctors.ViewAllDoctors();
 }