コード例 #1
0
 private void LoadTreeView()
 {
     oBDonVi             = new cBNS_DonVi();
     dtTree              = oBDonVi.Get_Tree();
     trvDonVi.DataSource = dtTree;
     trvDonVi.ExpandAll();
 }
コード例 #2
0
        private void frmCapNhatAnhGiaoVien_Load(object sender, EventArgs e)
        {
            cBNS_DonVi oBDonVi = new cBNS_DonVi();

            dtTree = oBDonVi.Get_Tree();
            trvDonVi.DataSource = dtTree;
            trvDonVi.ExpandAll();
        }
コード例 #3
0
 public frmLapTaiKhoanGiaoVien()
 {
     InitializeComponent();
     oBDonVi       = new cBNS_DonVi();
     pDonViInfo    = new NS_DonViInfo();
     oBGiaoVien    = new cBNS_GiaoVien();
     pGiaoVienInfo = new NS_GiaoVienInfo();
 }
コード例 #4
0
        private void btnLuu_Click(object sender, EventArgs e)
        {
            if (!CheckValid())
            {
                return;
            }
            Tag     = 1;
            oBDonVi = new cBNS_DonVi();
            ReadTextBox();
            DataRow drNew;

            if (EditMode == EDIT_MODE.SUA)
            {
                oBDonVi.Update(pDonViInfo);
                GhiLog("Sửa đơn vị '" + pDonViInfo.TenDonVi + "'", "Sửa", this.Tag.ToString());
                SuaThanhCong();
                this.Close();
            }
            else if (EditMode == EDIT_MODE.THEM && InsertParent == true)
            {
                pDonViInfo.NS_DonViID = oBDonVi.Add(pDonViInfo);
                drNew = dtTree.NewRow();
                oBDonVi.ToDataRow(pDonViInfo, ref drNew);
                drNew["ParentIDs"] = ParentIDs;
                dtTree.Rows.Add(drNew);
                // ghi log
                GhiLog("Thêm đơn vị '" + pDonViInfo.TenDonVi + "'", "Thêm", this.Tag.ToString());
                //ThemThanhCong();
            }
            else if (EditMode == EDIT_MODE.THEM && InsertParent == false)
            {
                pDonViInfo.ParentID = pDonViInfo.NS_DonViID;
                pDonViInfo.Level    = Level + 1;
                int NS_DonViID = oBDonVi.Add(pDonViInfo);
                drNew = dtTree.NewRow();
                oBDonVi.ToDataRow(pDonViInfo, ref drNew);
                drNew["ParentID"]  = NS_DonViID;
                drNew["ParentIDs"] = ParentIDs;
                dtTree.Rows.Add(drNew);
                GhiLog("Thêm đơn vị '" + pDonViInfo.TenDonVi + "'", "Thêm", this.Tag.ToString());
                //ThemThanhCong();
            }
            ClearText();
        }