Ejemplo n.º 1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            frmAddKhachHang f = new frmAddKhachHang();

            f.ShowDialog(this);
            gridControl1.DataSource = KhachHangController.GetList();
        }
Ejemplo n.º 2
0
 private void lookUpEditKhachHang_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
 {
     if (e.Button.Caption.ToUpper().Equals("FIND"))
     {
         frmAddKhachHang f = new frmAddKhachHang();
         f.ShowDialog(this);
         lookUpEditKhachHang.Properties.DataSource = KhachHangController.GetList();
         if (f.strNewKhachHangID != string.Empty)
         {
             lookUpEditKhachHang.EditValue = f.strNewKhachHangID;
         }
         f.Dispose();
     }
 }
Ejemplo n.º 3
0
        private void gridView1_DoubleClick(object sender, EventArgs e)
        {
            int intRow = gridView1.FocusedRowHandle;

            if (intRow >= 0)
            {
                string    strKhachHangID = gridView1.GetRowCellValue(intRow, "KhachHangID").ToString();
                KhachHang item           = KhachHangController.GetItem(strKhachHangID);
                if (item != null)
                {
                    frmAddKhachHang f = new frmAddKhachHang();
                    f.frmMode  = "edit";
                    f.EditItem = item;
                    f.ShowDialog(this);
                    gridControl1.DataSource    = KhachHangController.GetList();
                    gridView1.FocusedRowHandle = intRow;
                }
            }
        }