Exemplo n.º 1
0
 public BenhNhan GetInfBenhNhan()
 {
     BenhNhan bn = new BenhNhan();
     bn.ID = txtFileNumberPatient.Text;
     bn.DiaChi = string.Empty;
     bn.NgayKhamLanDau = (DateTime)datDateOfFirst.EditValue;
     bn.NgaySinh = DateTime.Now;
     bn.SoDT = string.Empty;
     bn.TenBN = txtNamePatient.Text;
     return bn;
 }
Exemplo n.º 2
0
        private void repositoryItembtnAddNew_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            // Get your currently selected grid row
            var rowHandle = gridView1.FocusedRowHandle;

            // Get the value for the given column - convert to the type you're expecting
            string maBN = gridView1.GetRowCellValue(rowHandle, "ID").ToString();
            BenhNhan bn = new BenhNhan();
            bn.ID = maBN;
            bn.NgayKhamLanDau = (DateTime)(gridView1.GetRowCellValue(rowHandle, "NgayKhamLanDau"));
            bn.TenBN = gridView1.GetRowCellValue(rowHandle, "TenBN").ToString();
            frmSystem_ListPatient_AddNew_v2 child = new frmSystem_ListPatient_AddNew_v2 { BN = bn };

            //child.AddItemCallback = new AddItemDelegate(this.AddItemCallbackFn);
            child.ShowDialog();
        }
Exemplo n.º 3
0
 public bool UpdateBenhNhan(BenhNhan BenhNhan)
 {
     DataClassesDataContext data = new DataClassesDataContext(Connection);
     BenhNhan NDOld = data.BenhNhans.Where(i => i.ID == BenhNhan.ID).SingleOrDefault();
     NDOld.DiaChi = BenhNhan.DiaChi;
     NDOld.ID = BenhNhan.ID;
     NDOld.NgayKhamLanDau = BenhNhan.NgayKhamLanDau;
     NDOld.NgaySinh = BenhNhan.NgaySinh;
     NDOld.SoDT = BenhNhan.SoDT;
     NDOld.TenBN = BenhNhan.TenBN;
     try
     {
         data.SubmitChanges();
         return true;
     }
     catch (Exception)
     {
         return false;
     }
 }
Exemplo n.º 4
0
 public bool InsertBenhNhan(BenhNhan BenhNhan)
 {
     DataClassesDataContext data = new DataClassesDataContext(Connection);
     data.BenhNhans.InsertOnSubmit(BenhNhan);
     try
     {
         data.SubmitChanges();
         return true;
     }
     catch (Exception e)
     {
         return false;
     }
 }
Exemplo n.º 5
0
 partial void DeleteBenhNhan(BenhNhan instance);
Exemplo n.º 6
0
 partial void UpdateBenhNhan(BenhNhan instance);
Exemplo n.º 7
0
 partial void InsertBenhNhan(BenhNhan instance);