示例#1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            frmAddNhaCungCap f = new frmAddNhaCungCap();

            f.ShowDialog(this);
            gridControl1.DataSource = NhaCungCapControlller.GetList();
        }
示例#2
0
 private void lookUpEditNhaCungCap_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
 {
     if (e.Button.Caption.ToUpper().Equals("ADD"))
     {
         frmAddNhaCungCap f = new frmAddNhaCungCap();
         f.ShowDialog(this);
         lookUpEditNhaCungCap.Properties.DataSource = NhaCungCapControlller.GetList();
         if (f.strNewNhaCungCapID != string.Empty)
         {
             lookUpEditNhaCungCap.EditValue = f.strNewNhaCungCapID;
         }
         f.Dispose();
     }
 }
示例#3
0
        private void gridView1_DoubleClick(object sender, EventArgs e)
        {
            int intRow = gridView1.FocusedRowHandle;

            if (intRow >= 0)
            {
                string     strNhaCungCapID = gridView1.GetRowCellValue(intRow, "NhaCungCapID").ToString();
                NhaCungCap item            = NhaCungCapControlller.GetItem(strNhaCungCapID);
                if (item != null)
                {
                    frmAddNhaCungCap f = new frmAddNhaCungCap();
                    f.frmMode  = "edit";
                    f.EditItem = item;
                    if (f.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
                    {
                        gridControl1.DataSource    = NhaCungCapControlller.GetList();
                        gridView1.FocusedRowHandle = intRow;
                    }
                }
            }
        }