public void InitializeLoaiCoSo()
        {
            try
            {
                cboCoSo.DataSource    = CoSoTrungTamLogic.SelectAll();
                cboCoSo.DisplayMember = "TenCoSo";
                cboCoSo.ValueMember   = "CoSoId";

                cboCoSo.SelectedIndex = 0;
            }
            catch (Exception ex)
            {
                O2S_Common.Logging.LogSystem.Error(ex);
            }
        }
 private void LayCoSoTrungTam()
 {
     try
     {
         if (GlobalSettings.UserType != UserType.HocVien) //khong phai Hoc vien
         {
             List <COSOTRUNGTAM> ObjectList = CoSoTrungTamLogic.SelectAll() as List <COSOTRUNGTAM>;
             if (ObjectList.Count == 1)
             {
                 GlobalSettings.CoSoId      = ObjectList[0].CoSoId;
                 GlobalSettings.CoSo_Ten    = ObjectList[0].TenCoSo;
                 GlobalSettings.CoSo_DiaChi = ObjectList[0].DiaChi;
                 GlobalSettings.CoSo_Sdt    = ObjectList[0].Sdt;
                 GlobalSettings.CoSo_Email  = ObjectList[0].Email;
                 if (ObjectList[0].LogoCoSo != null && ObjectList[0].LogoCoSo.Length > 0)
                 {
                     byte[] Empimage = (byte[])(ObjectList[0].LogoCoSo).ToArray();
                     GlobalSettings.CoSo_LogoCoSo = Image.FromStream(new MemoryStream(Empimage));
                 }
                 else
                 {
                     GlobalSettings.CoSo_LogoCoSo = null;
                 }
             }
             else
             {
                 frmChonCoSo _frm = new frmChonCoSo();
                 _frm.ShowDialog();
             }
         }
     }
     catch (Exception ex)
     {
         O2S_Common.Logging.LogSystem.Error(ex);
     }
 }
Exemplo n.º 3
0
 public void LoadGridKhoaHoc()
 {
     gridKH.DataSource = CoSoTrungTamLogic.SelectAll();
 }