private bool checkTimeAble(string s) { ControllerDatlich t = new ControllerDatlich(); string datetime = Form1.date + " " + s[0].ToString() + s[1].ToString() + ":00:00"; return(t.listTimeAble(datetime, Form1.Doctor_name).Count < Doctor.cap + 1); }
private void cbMajor_MouseClick(object sender, MouseEventArgs e) { txtDoctor.Enabled = true; ControllerDatlich listMajor = new ControllerDatlich(); cbMajor.DataSource = listMajor.listMajor(); }
private void Confirm_Click(object sender, EventArgs e) { if ((txtDate.Text == defaultDate) || (txtDoctor.Text == defaultName) || (cbMajor.Text == defaultMajor) || (txtDoctor.Text == "") || (txtTime.Text == defaultTime)) { MessageBox.Show("Ban chua dien du thong tin!!!"); } else { ControllerDatlich control = new ControllerDatlich(); control.addVisit(txtDate.Text, t, txtTime.Text, BHYT); control.GuiMail(email); this.Close(); } }
public Form2(Form1 f1in) { InitializeComponent(); Form1 t = new Form1(); this.Width = t.Width; this.Height = t.Height; ControllerDatlich display = new ControllerDatlich(); chooseDoc.DataSource = display.GetDataBaseCommand(display.showDoctor()).Tables[0]; chooseDoc.Columns[0].HeaderText = "ID"; chooseDoc.Columns[1].HeaderText = "Tên bác sĩ"; chooseDoc.Columns[2].HeaderText = "Chuyên khoa"; chooseDoc.Columns[3].HeaderText = "Giá tiền"; chooseDoc.Columns[4].HeaderText = "Đánh giá"; chooseDoc.Width = this.Width; chooseDoc.Height = this.Height; f1out = f1in; }
public Form1() { InitializeComponent(); Date_panel.Visible = false; pictureBox1.Width = pictureBox1.Height = panel1.Width - 30; System.Drawing.Drawing2D.GraphicsPath gp = new System.Drawing.Drawing2D.GraphicsPath(); gp.AddEllipse(0, 0, pictureBox1.Width - 3, pictureBox1.Height - 3); Region rg = new Region(gp); pictureBox1.Region = rg; name.Text = ControllerDatlich.name_benhnhan; mabn.Text = ControllerDatlich.id_benhnhan.ToString(); ControllerDatlich t = new ControllerDatlich(); string query = "select email from PatientInfo where id = " + mabn.Text; SqlConnection conn = new SqlConnection(ConnectString.connectString); conn.Open(); List <string> listItem = new List <string>(); using (SqlCommand command = new SqlCommand(query, conn)) { using (SqlDataReader reader = command.ExecuteReader()) { while (reader.Read()) { listItem.Add(reader.GetString(0)); } } } conn.Close(); email1.Text = listItem[0]; defaultDate = txtDate.Text; defaultMajor = cbMajor.Text; defaultName = txtDoctor.Text; defaultTime = txtTime.Text; mabenhnhan = mabn.Text; email = email1.Text; tenbenhnhan = name.Text; }