Example #1
0
        private async void MainForm_Load(object sender, EventArgs e)
        {
            sttHeader.Caption = "ĐÃ ĐĂNG NHẬP!";

            RibbonPageGroup group = ribMainMenu.GetGroupByName("grpThietLap");

            ribMainMenu.SelectedPage = ribMainMenu.Pages[1];

            //BarEditItem cbx
            //cbxHocKy.Items.addrange()

            dateNgay.EditValue       = DateTime.Now;
            edtNgayTruong.EditValue  = DateTime.Now;
            edtNgayLop.EditValue     = DateTime.Now;
            dateNgayTruong.EditValue = DateTime.Now;
            dateNgayLop.EditValue    = DateTime.Now;

            //Người ký
            string ngKy = File.ReadAllText("nguoiKy.txt");

            string[] strs = ngKy.Split(new char[] { '|' });
            txtNguoiDuyet.EditValue = strs[0]; NguoiDuyet = strs[0];
            txtNguoiKy.EditValue    = strs[1]; NguoiKy = strs[1];
            txtTrucBan.EditValue    = strs[2]; TrucBan = strs[2];

            //Size
            string size = File.ReadAllText("coChu.txt");

            string[] sizes = size.Split(new char[] { '|' });
            cbxCoChuHK.EditValue   = sizes[0]; sizeHocKy = Int16.Parse(sizes[0]);
            cbxCoChuTuan.EditValue = sizes[1]; sizeTuan = Int16.Parse(sizes[1]);
            cbxCoChuNgay.EditValue = sizes[2]; sizeNgay = Int16.Parse(sizes[2]);

            //HocKy
            string _hk = File.ReadAllText("hocKy.txt");

            string[] hk = _hk.Split(new char[] { '|' });
            HocKy = await apis.GetHocKy(hk[0], Int16.Parse(hk[1]));

            //Binding bd = new Binding("", hks, "ten");
            //cbxHocKy.DataBindings.Add(bd);

            if (HocKy == null)
            {
                ribMainMenu.Enabled = false;
                return;
            }
            lblHocKy.Caption    = HocKy.ToString();
            cbxNamHoc.EditValue = HocKy.namHoc;
            cbxHocKy.EditValue  = hk[1];
        }