Beispiel #1
0
 private void barButtonItem_DuAn_ItemClick(object sender, ItemClickEventArgs e)
 {
     if (formTenDuAn == null)
     {
         formTenDuAn             = new F_Main_SoQuyetDinh();
         formTenDuAn.MdiParent   = this;
         formTenDuAn.FormClosed += new FormClosedEventHandler(formTenDuAn_FormClosed);
         formTenDuAn.Show();
     }
     else
     {
         formTenDuAn.Activate();
     }
 }
Beispiel #2
0
        public F_Main_ThemDuAn(F_Main_SoQuyetDinh frm, string id)
        {
            InitializeComponent();
            System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;

            this.LoadData();
            this.Text = "Chỉnh sửa thông tin dự án";
            string s = "SELECT TenDuan, Diadiem, convert(NVARCHAR, Ngaygiao, 101) as NgayGiao, MaDvhc, SoQD, convert(NVARCHAR, NgayQD, 101) as NgayQD, MaHinhthuc, YEAR(Thoihan)-YEAR(Ngaygiao) as SoNam , TinhtrangPL, MaTochuc FROM Giaodat WHERE IDGD = " + id;

            this.formTenDuAn = frm;
            this.IDGD        = id;
            this.soQD        = sql.GetData(s, 4);

            textEdit_tenDuAn.Text            = sql.GetData(s, 0);
            textEdit_diaDiem.Text            = sql.GetData(s, 1);
            dateEdit_NgayGiao.EditValue      = sql.GetData(s, 2);
            lookUpEdit_Huyen.EditValue       = sql.GetData(s, 3);
            textEdit_SoQD.Text               = sql.GetData(s, 4);
            dateEdit_NgayQD.EditValue        = sql.GetData(s, 5);
            lookUpEdit_HinhThuc.EditValue    = sql.GetData(s, 6);
            spinEdit_ThoiHan.Value           = int.Parse(sql.GetData(s, 7).ToString().Trim());
            lookUpEdit_TinhTrangPL.EditValue = sql.GetData(s, 8);
            lookUpEdit_MaToChuc.EditValue    = sql.GetData(s, 9);

            DataColumn[] Array_coltruoc = { col_truoc1, col_truoc2 };
            s = "SELECT [MaLD],[Dientich] FROM [GIAODAT].[dbo].[LDTruocGiao] WHERE IDGD = " + id;
            sql.ViewDataTable(s, table_Truoc, Array_coltruoc);

            DataColumn[] Array_colsau = { col_sau1, col_sau2 };
            s = "SELECT [MaLD],[Dientich] FROM [GIAODAT].[dbo].[LDDuocGiao] WHERE IDGD = " + id;
            sql.ViewDataTable(s, table_Sau, Array_colsau);


            simpleButton_NhapLai.Enabled = false;

            Cursor = Cursors.Default;
        }
Beispiel #3
0
 private void formTenDuAn_FormClosed(object sender, FormClosedEventArgs e)
 {
     formTenDuAn = null;
 }