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