private void cmdAdd_CommandClick(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e)
 {
     //cmdNew cmdEdit cmdDelete cmdExit cmdHelp
     if (e.Command.Key == "cmdNew")
     {
         this.ThemKhachAo();
     }
     else if (e.Command.Key == "cmdEdit")
     {
         this.SuaKhachAo();
     }
     else if (e.Command.Key == "cmdDelete")
     {
         this.XoaKhachAo();
     }
     else if (e.Command.Key == "cmdExit")
     {
         this.Close();
         this.Dispose();
     }
     else if (e.Command.Key == "cmdHelp")
     {
         frmKhachAoTimKiem frm = new frmKhachAoTimKiem();
         if (frm.ShowDialog(this) == DialogResult.OK)
         {
             if (frm.GetResultListOfKhachAo().Count > 0)
             {
                 gridKhachAo.DataSource = null;
                 gridKhachAo.DataMember = "ListOfKhachAo";
                 gridKhachAo.SetDataBinding(frm.GetResultListOfKhachAo(), "ListOfKhachAo");
             }
             else
             {
                 new MessageBox.MessageBoxBA().Show("Không tìm thấy kết quả nào");
                 return;
             }
         }
     }
 }
Пример #2
0
 private void btnTimKiem_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     try
     {
         frmKhachAoTimKiem frm = new frmKhachAoTimKiem();
         if (frm.ShowDialog(this) == DialogResult.OK)
         {
             if (frm.GetResultListOfKhachAo().Count > 0)
             {
                 gridDanhMucKhachAo.DataSource = frm.GetResultListOfKhachAo();
             }
             else
             {
                 new MessageBox.MessageBoxBA().Show("Không tìm thấy kết quả nào");
             }
         }
     }
     catch (Exception ex)
     {
         LogError.WriteLogError("btnTimKiem_ItemClick: ", ex);
     }
 }