Example #1
0
        private void grpc2_CustomButtonClick(object sender, DevExpress.XtraBars.Docking2010.BaseButtonEventArgs e)
        {
            if (chinhSachOBindingSource.Count > 1)
            {
                switch (e.Button.Properties.Caption)
                {
                case "Thêm":
                    XuLyDuLieu.ConvertClassToTable(this, new O_CTCHINHSACH());
                    igroupControl1.Text = "Chi tiết chính sách thêm";
                    btnHuy.Enabled      = btnLuu.Enabled = true;
                    chk.Checked         = true;
                    break;

                default:
                    if (GVCTCS.GetSelectedRows().Count() > 0)
                    {
                        _CTchinhSachO = GVCTCS.GetRow(GVCTCS.GetSelectedRows()[0]) as O_CTCHINHSACH;
                        if (_CTchinhSachO != null)
                        {
                            btnHuy.Enabled      = btnLuu.Enabled = true;
                            igroupControl1.Text = "Chi tiết chính sách sửa";
                            XuLyDuLieu.ConvertClassToTable(this, _CTchinhSachO);
                            chk.Checked = false;
                        }
                    }
                    break;
                }
            }
        }
Example #2
0
 private void GVCTCS_Click(object sender, EventArgs e)
 {
     if (GVCTCS.GetSelectedRows().Count() > 0)
     {
         _CTchinhSachO = GVCTCS.GetRow(GVCTCS.GetSelectedRows()[0]) as O_CTCHINHSACH;
         if (_CTchinhSachO != null)
         {
             XuLyDuLieu.ConvertClassToTable(this, _CTchinhSachO);
             igroupControl1.Text = "Chi tiết chính sách";
         }
     }
 }