/// <summary>
 /// Mo form KhachVIP de edit
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void grdKhachVIP_DoubleClick(object sender, EventArgs e)
 {
     grdKhachVIP.SelectionMode = Janus.Windows.GridEX.SelectionMode.SingleSelection;
     if (grdKhachVIP.SelectedItems.Count > 0)
     {
         GridEXRow   row         = ((GridEXSelectedItem)grdKhachVIP.SelectedItems[0]).GetRow();
         KhachVIP    objKhachVIP = (KhachVIP)((GridEXSelectedItem)grdKhachVIP.SelectedItems[0]).GetRow().DataRow;
         frmKhachVIP frm         = new frmKhachVIP(objKhachVIP, false);
         if (frm.ShowDialog(this) == DialogResult.OK)
         {
             objKhachVIP = frm.GetKhachVIP();
             frm.Dispose();
             //Insert DataBase
             if (!objKhachVIP.Update())
             {
                 new MessageBox.MessageBoxBA().Show("Lỗi thêm mới khách VIP");
                 return;
             }
             else
             {
                 //Load lai grid
                 LoadListKhachVIP();
             }
         }
         else
         {
             return;
         }
     }
 }
        private void SuaKhachVIP()
        {
            grdKhachVIP.SelectionMode = Janus.Windows.GridEX.SelectionMode.SingleSelection;
            if (grdKhachVIP.SelectedItems.Count > 0)
            {
                GridEXRow   row         = ((GridEXSelectedItem)grdKhachVIP.SelectedItems[0]).GetRow();
                KhachVIP    objKhachVIP = (KhachVIP)((GridEXSelectedItem)grdKhachVIP.SelectedItems[0]).GetRow().DataRow;
                frmKhachVIP frm         = new frmKhachVIP(objKhachVIP, false);
                if (frm.ShowDialog(this) == DialogResult.OK)
                {
                    objKhachVIP = frm.GetKhachVIP();
                    if (StringTools.TrimSpace(objKhachVIP.Name).Length <= 0)
                    {
                        return;
                    }

                    if (StringTools.TrimSpace(objKhachVIP.Address).Length <= 0)
                    {
                        return;
                    }

                    if (StringTools.TrimSpace(objKhachVIP.Phones).Length < 8)
                    {
                        return;
                    }
                    //Insert DataBase
                    if (!objKhachVIP.Update())
                    {
                        new MessageBox.MessageBoxBA().Show("Lỗi thêm mới khách VIP");
                        return;
                    }
                    else
                    {
                        //Load lai grid
                        LoadListKhachVIP();
                    }
                }
                else
                {
                    return;
                }
            }
        }
        private void ThemKhachVIP()
        {
            // Khoi tao doi tuong KhachVIP voi ma
            string strMaKhachVIP = KhachVIP.GetNextMaKhachVIP();

            if (strMaKhachVIP.Length > 0)
            {
                KhachVIP    objKhachVIP = new KhachVIP(strMaKhachVIP, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, true);
                frmKhachVIP frm         = new frmKhachVIP(objKhachVIP, true);// them moi
                if (frm.ShowDialog(this) == DialogResult.OK)
                {
                    objKhachVIP = frm.GetKhachVIP();

                    //Insert DataBase
                    if (!objKhachVIP.Insert())
                    {
                        new MessageBox.MessageBoxBA().Show("Lỗi thêm mới khách VIP");
                        return;
                    }
                    else
                    {
                        //Load lai grid
                        LoadListKhachVIP();
                    }
                }
                else
                {
                    return;
                }
            }
            else
            {
                new MessageBox.MessageBoxBA().Show("Hết mã cho khách VIP, liên hệ với quản trị");
                return;
            }
        }