private void ThemKhachQuen()
        {
            DanhBaKhachQuen objKhachQuen = new DanhBaKhachQuen();
            frmKhachQuen    frm          = new frmKhachQuen(objKhachQuen, true, G_lstKhachQuen_Type, G_lstKhachQuen_Rank);// them moi

            if (frm.ShowDialog(this) == DialogResult.OK)
            {
                objKhachQuen = frm.GetKhachQuen();
                //Insert DataBase
                if (!objKhachQuen.Insert())
                {
                    new MessageBox.MessageBoxBA().Show("Lỗi thêm mới khách quen");
                }
                else
                {
                    //Load lai grid
                    LoadListKhachQuen();
                }
            }
        }
Beispiel #2
0
        private void btnThemKhachQuen_Click(object sender, EventArgs e)
        {
            DanhBaKhachQuen dbKhachQuen = new DanhBaKhachQuen(g_SoDienThoai, "", "", new DateTime(2000, 01, 01, 0, 0, 0), "", "", "", false, "", 0, 0);

            using (frmKhachQuen frm = new frmKhachQuen(dbKhachQuen, true))
            {
                if (frm.ShowDialog() == DialogResult.OK)
                {
                    dbKhachQuen = frm.GetKhachQuen();
                    //Insert DataBase
                    if (!dbKhachQuen.Insert())
                    {
                        new MessageBox.MessageBoxBA().Show("Lỗi thêm mới khách quen");
                    }
                    else
                    {
                        new MessageBox.MessageBoxBA().Show("Thêm mới khách quen thành công");
                    }
                }
            }
        }
Beispiel #3
0
 private void ThemKhachQuen()
 {
     try
     {
         DanhBaKhachQuen objKhachQuen = new DanhBaKhachQuen();
         frmKhachQuen    frm          = new frmKhachQuen(objKhachQuen, true, G_lstKhachQuen_Type, G_lstKhachQuen_Rank);
         if (frm.ShowDialog(this) == DialogResult.OK)
         {
             objKhachQuen = frm.GetKhachQuen();
             if (!objKhachQuen.Insert())
             {
                 new MessageBoxBA().Show("Lỗi thêm mới khách quen");
             }
             else
             {
                 LoadListKhachQuen();
             }
         }
     }
     catch (Exception ex)
     {
         LogError.WriteLogError("ThemKhachQuen: ", ex);
     }
 }