Пример #1
0
        //private void LoadListKhachQuen_Type()
        //{
        //    G_lstKhachQuen_Type = new List<DanhBaKhachQuen_Type>();
        //    G_lstKhachQuen_Type = DanhBaKhachQuen_Type.GetDanhSachKhachQuen_Type();
        //}

        //private void LoadListKhachQuen_Rank()
        //{
        //    G_lstKhachQuen_Rank = new List<DanhBaKhachQuen_Rank>();
        //    G_lstKhachQuen_Rank = DanhBaKhachQuen_Rank.GetDanhSachKhachQuen_Rank();
        //}

        #endregion

        #region =========================Get Data==============================

        #endregion

        #region ======================Validation Form==========================

        #endregion

        #region ========================Form Events============================
        private void cmdAdd_CommandClick(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e)
        {
            //cmdNew cmdEdit cmdDelete cmdExit cmdHelp
            if (e.Command.Key == "cmdNew")
            {
                this.ThemKhachQuen();
            }
            else if (e.Command.Key == "cmdEdit")
            {
                this.SuaKhachQuen();
            }
            else if (e.Command.Key == "cmdDelete")
            {
                this.XoaKhachQuen();
            }
            else if (e.Command.Key == "cmdExit")
            {
                this.Close();
                this.Dispose();
            }
            else if (e.Command.Key == "cmdExportExcel")
            {
                string FilenameDefault = "DSKhachHangThanThiet.xls";
                saveFileDialog1.FileName = FilenameDefault;
                if (saveFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    FileStream objFile = new FileStream(saveFileDialog1.FileName, FileMode.OpenOrCreate);
                    gridEXExporter1.Export((Stream)objFile);
                    Thread.Sleep(200);
                    objFile.Close();
                    new MessageBox.MessageBoxBA().Show("Tạo file Excel thành công.", "Thông báo");
                }
            }
            else if (e.Command.Key == "cmdHelp")
            {
                frmKhachQuenTimKiem frm = new frmKhachQuenTimKiem();
                if (frm.ShowDialog(this) == DialogResult.OK)
                {
                    if (frm.GetResultListOfKhachQuen().Count > 0)
                    {
                        gridKhachAo.DataSource = null;
                        gridKhachAo.DataMember = "ListOfKhachAo";
                        gridKhachAo.SetDataBinding(frm.GetResultListOfKhachQuen(), "ListOfKhachAo");
                    }
                    else
                    {
                        new MessageBox.MessageBoxBA().Show("Không tìm thấy kết quả nào");
                        return;
                    }
                }
            }
        }
 private void cmdAdd_CommandClick(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e)
 {
     //cmdNew cmdEdit cmdDelete cmdExit cmdHelp
     if (e.Command.Key == "cmdNew")
     {
         this.ThemKhachQuen();
     }
     else if (e.Command.Key == "cmdEdit")
     {
         this.SuaKhachQuen();
     }
     else if (e.Command.Key == "cmdDelete")
     {
         this.XoaKhachQuen();
     }
     else if (e.Command.Key == "cmdExit")
     {
         this.Close();
         this.Dispose();
     }
     else if (e.Command.Key == "cmdHelp")
     {
         frmKhachQuenTimKiem frm = new frmKhachQuenTimKiem();
         if (frm.ShowDialog(this) == DialogResult.OK)
         {
             if (frm.GetResultListOfKhachQuen().Count > 0)
             {
                 gridKhachAo.DataSource = null;
                 gridKhachAo.DataMember = "ListOfKhachAo";
                 gridKhachAo.SetDataBinding(frm.GetResultListOfKhachQuen(), "ListOfKhachAo");
             }
             else
             {
                 new MessageBox.MessageBoxBA().Show("Không tìm thấy kết quả nào");
                 return;
             }
         }
     }
     else if (e.Command.Key == "cmdInportExcel")
     {
         OpenFile();
     }
 }
        private void mnuTimKiem_Click(object sender, EventArgs e)
        {
            frmKhachQuenTimKiem frm = new frmKhachQuenTimKiem();

            if (frm.ShowDialog(this) == DialogResult.OK)
            {
                if (frm.GetResultListOfKhachQuen().Count > 0)
                {
                    gridKhachAo.DataSource = null;
                    gridKhachAo.DataMember = "ListOfKhachAo";
                    gridKhachAo.SetDataBinding(frm.GetResultListOfKhachQuen(), "ListOfKhachAo");
                }
                else
                {
                    new MessageBox.MessageBox().Show("Không tìm thấy kết quả nào");
                    return;
                }
            }
        }
Пример #4
0
 private void barButton_Search_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     try
     {
         frmKhachQuenTimKiem frm = new frmKhachQuenTimKiem();
         if (frm.ShowDialog(this) == DialogResult.OK)
         {
             var lstKhachQuen = frm.GetResultListOfKhachQuen();
             if (lstKhachQuen.Count > 0)
             {
                 gridKhachQuen.DataSource = lstKhachQuen;
             }
             else
             {
                 new MessageBoxBA().Show("Không tìm thấy kết quả nào");
             }
         }
     }
     catch (Exception ex)
     {
         LogError.WriteLogError("barButton_Search_ItemClick: ", ex);
     }
 }