Esempio n. 1
0
        private void keDonThuoc_Click(object sender, EventArgs e)
        {
            PrescriptionLog log = new PrescriptionLog(this.doctor, this.customer);

            log.Show();
            this.Hide();
        }
Esempio n. 2
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            try
            {
                if (string.IsNullOrEmpty(txtName.Text) || string.IsNullOrEmpty(txtAddress.Text))
                {
                    MessageBox.Show("Vui lòng nhập thông tin");
                    return;
                }
                Database.DTO.Customer customer = new Database.DTO.Customer
                {
                    Name      = txtName.Text,
                    Address   = txtAddress.Text,
                    Phone     = txtPhone.Text,
                    BirthDate = txtBirthDate.Text,
                };
                int id = -1;
                try
                {
                    id = int.Parse(txtId.Text);
                }
                catch (Exception)
                {
                }


                customer.Id = id;
                if (rbFemale.Checked)
                {
                    customer.Gender = 1;
                }
                else
                {
                    customer.Gender = 0;
                }

                _customerBLL.AddOrUpdate(customer);
                var _id = _customerBLL.GetByPhone(customer.Phone).Id;
                customer.Id = _id;
                MessageBox.Show("Cập nhật thông tin khách hàng thành công");
                PrescriptionLog pre = new PrescriptionLog(this.currentDoctor, customer);
                pre.Show();
                this.Hide();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Esempio n. 3
0
 private void dgvCustomer_Click(object sender, EventArgs e)
 {
     try
     {
         if (dgvCustomer.SelectedRows.Count > 0)
         {
             int             id           = int.Parse(dgvCustomer.SelectedRows[0].Cells["Id"].Value.ToString());;
             var             customer     = _customerBLL.GetCustomer(id);
             PrescriptionLog customerForm = new PrescriptionLog(this.Doctor, customer);
             customerForm.Show();
             this.Hide();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Esempio n. 4
0
 private void btnXuat_Click(object sender, EventArgs e)
 {
     prescription.CustomerId  = this.customer.Id;
     prescription.DoctorId    = this.doctor.Id;
     prescription.Diagnostic  = txtDiagnostic.Text;
     prescription.Description = txtDescription.Text;
     prescription.Details     = this._prescriptionDetails;
     try
     {
         _presctiptionBBL.Create(prescription);
         MessageBox.Show("Tạo đơn thuốc thành công!!!");
         PrescriptionLog log = new PrescriptionLog(this.doctor, this.customer);
         log.Show();
         this.Hide();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }