Ejemplo n.º 1
0
 private void butLuu_Click(object sender, EventArgs e)
 {
     dachon = false;
     foreach (DataRow r in dtVaccin.Rows)
     {
         if (r["phanung"].ToString() == "1")
         {
             dachon = true;
         }
     }
     if (!dachon)
     {
         MessageBox.Show(lan.Change_language_MessageText("Yêu cầu chọn Vacxin gây phản ứng!"), LibMedi.AccessData.Msg);
         return;
     }
     if (!m.bNgay(txtngay.Text))
     {
         MessageBox.Show(lan.Change_language_MessageText("Ngày tiêm không hợp lệ !"), LibMedi.AccessData.Msg);
         txtngay.Focus();
         return;
     }
     if (!m.upd_phanung_sautc(s_mabn, d_id, 1, txtTenbome.Text.Trim(), txtMota.Text.Trim(), txtTiensu.Text.Trim(), int.Parse(cmbTinhtrang.SelectedValue.ToString()), txtGhichu.Text.Trim(), txtngay.Text.Trim(), i_userid))
     {
         MessageBox.Show(lan.Change_language_MessageText("Không cập nhật được thông tin  !"), LibMedi.AccessData.Msg);
         return;
     }
     foreach (DataRow r in dtVaccin.Rows)
     {
         m.execute_data("update " + m.user + ".phieutiemchung set phanung=" + (r["phanung"].ToString() == "1"?"1":"0") + " where mabd=" + r["mabd"].ToString() + " and id=" + d_id);
     }
     //if(!bIn)
     //    MessageBox.Show(lan.Change_language_MessageText("Cập nhật thành công !"), LibMedi.AccessData.Msg);
 }
Ejemplo n.º 2
0
 private void ngay_Validated(object sender, EventArgs e)
 {
     if (ngay.Text == "")
     {
         ngay.Focus();
         return;
     }
     ngay.Text = ngay.Text.Trim();
     if (ngay.Text.Length == 6)
     {
         ngay.Text = ngay.Text + DateTime.Now.Year.ToString();
     }
     if (ngay.Text.Length < 10)
     {
         MessageBox.Show(lan.Change_language_MessageText("Yêu cầu nhập ngày !"));
         ngay.Focus();
         return;
     }
     if (!m.bNgay(ngay.Text))
     {
         MessageBox.Show(lan.Change_language_MessageText("Ngày và giờ không hợp lệ !"));
         ngay.Focus();
         return;
     }
 }
Ejemplo n.º 3
0
 private void butLuu_Click(object sender, EventArgs e)
 {
     if (!m.bNgay(txtNgay.Text))
     {
         return;
     }
     if (txtMabs.Text.Trim() == "" || txtChidinh.Text.Trim() == "")
     {
         MessageBox.Show(lan.Change_language_MessageText("Nhập bác sĩ!"), LibMedi.AccessData.Msg);
         txtMabs.Focus();
         return;
     }
     if (bNew)
     {
         d_id = m.getidyymmddhhmiss_stt_computer_khudt(0);
     }
     if (!m.upd_theodoivltl(d_id, s_mabn, d_mavaovien, d_maql, txtNgay.Text, txtMabs.Text.Trim(), txtSieuam.Text.Trim(), txtKeocs.Text.Trim(), txtDien.Text.Trim(), txtTutruong.Text.Trim(), txtApsuat.Text.Trim(), txtKhac.Text.Trim(), i_userid))
     {
         MessageBox.Show(lan.Change_language_MessageText("Không cập nhật được thông tin!"), LibMedi.AccessData.Msg);
         return;
     }
     load_data();
     cmbNgay.SelectedIndex = 0;
     ena_object(false);
 }