Example #1
0
        public void LoadCBB()
        {
            TheLoaiController theloaiControll = new TheLoaiController();

            _cbbtheloai.ItemsSource       = theloaiControll.GetAllTheLoai;
            _cbbtheloai.DisplayMemberPath = "TenTheLoai";
            TacGiaController tacgiaControll = new TacGiaController();

            _cbbtacgia.ItemsSource       = tacgiaControll.GetAllTacgia;
            _cbbtacgia.DisplayMemberPath = "TenTacGia";
            NXBController nxbcontroll = new NXBController();

            _cbbnxb.ItemsSource       = nxbcontroll.GetAllNxb;
            _cbbnxb.DisplayMemberPath = "TenNhaXB";
        }
Example #2
0
 public frmTheLoai()
 {
     InitializeComponent();
     theloaiControll = new TheLoaiController();
     nxbControll     = new NXBController();
     tacgiaControll  = new TacGiaController();
     LoadTGTable();
     LoadTheLoaiTable();
     LoadNXBTable();
     _txtmanxb.IsReadOnly     = true;
     _txtmatacgia.IsReadOnly  = true;
     _txtmatheloai.IsReadOnly = true;
     if (App.Role.AddAll == true)
     {
         _btnaddNXB.IsEnabled        = true;
         _btnaddTG.IsEnabled         = true;
         _btnaddTL.IsEnabled         = true;
         _btnaddTG_cancel.IsEnabled  = true;
         _btnaddNXB_cancel.IsEnabled = true;
         _btnaddTL_cancel.IsEnabled  = true;
     }
     else
     {
         if (App.Role.AddSach != true)
         {
             _btnaddNXB.IsEnabled        = false;
             _btnaddTG.IsEnabled         = false;
             _btnaddTL.IsEnabled         = false;
             _btnaddTG_cancel.IsEnabled  = false;
             _btnaddNXB_cancel.IsEnabled = false;
             _btnaddTL_cancel.IsEnabled  = false;
         }
     }
     if (App.Role.EditAll == true)
     {
         _btnsaveNXB.IsEnabled = true;
         _btnsaveTG.IsEnabled  = true;
         _btnsaveTL.IsEnabled  = true;
     }
     else
     {
         if (App.Role.EditSach != true)
         {
             _btnsaveNXB.IsEnabled = false;
             _btnsaveTG.IsEnabled  = false;
             _btnsaveTL.IsEnabled  = false;
         }
     }
     if (App.Role.DeleteAll == true)
     {
         _btndeleteNXB.IsEnabled = true;
         _btndeleteTG.IsEnabled  = true;
         _btndeleteTL.IsEnabled  = true;
     }
     else
     {
         if (App.Role.DeleteSach != true)
         {
             _btndeleteNXB.IsEnabled = false;
             _btndeleteTG.IsEnabled  = false;
             _btndeleteTL.IsEnabled  = false;
         }
     }
 }