示例#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;
                }
            }
        }
示例#2
0
 public void LayChiTiet()
 {
     if (HienDu2)
     {
         cTChinhSachOBindingSource.DataSource = _CTChinhSachD.DuLieu(_ChinhSachO.ID);
     }
     else
     {
         cTChinhSachOBindingSource.DataSource = _CTChinhSachD.DuLieu(_ChinhSachO.ID).Where(w => w.NgayB.Date > DateTime.Now.Date).ToList();
     }
     GVCTCS.BestFitColumns();
 }
示例#3
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";
         }
     }
 }