예제 #1
0
        private void F_Main_DMToChuc_Load(object sender, EventArgs e)
        {
            System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;

            sql   = F_DangNhap.SQL_con_object as SQLConnect;
            nguoi = F_DangNhap.person_object as NguoiDung;

            //Gridcontrol2 DSToChuc

            table_DSToChuc = new DataTable();

            co0            = new DataColumn();
            co0.DataType   = System.Type.GetType("System.Int32");
            co0.ColumnName = "STT";
            table_DSToChuc.Columns.Add(co0);


            co1            = new DataColumn();
            co1.DataType   = System.Type.GetType("System.String");
            co1.ColumnName = "Mã tổ chức";
            table_DSToChuc.Columns.Add(co1);

            co2            = new DataColumn();
            co2.DataType   = System.Type.GetType("System.String");
            co2.ColumnName = "Tên tổ chức";
            table_DSToChuc.Columns.Add(co2);

            co3            = new DataColumn();
            co3.DataType   = System.Type.GetType("System.String");
            co3.ColumnName = "Địa chỉ";
            table_DSToChuc.Columns.Add(co3);

            co4            = new DataColumn();
            co4.DataType   = System.Type.GetType("System.String");
            co4.ColumnName = "Mã số thuế";
            table_DSToChuc.Columns.Add(co4);

            co5            = new DataColumn();
            co5.DataType   = System.Type.GetType("System.String");
            co5.ColumnName = "Giám đốc";
            table_DSToChuc.Columns.Add(co5);

            co6            = new DataColumn();
            co6.DataType   = System.Type.GetType("System.String");
            co6.ColumnName = "Ngày thành lập";
            table_DSToChuc.Columns.Add(co6);

            gridControl1.Width                 = int.MaxValue;
            gridControl1.DataSource            = table_DSToChuc;
            gridView1.OptionsBehavior.Editable = false;
            //gridView1.OptionsView.ColumnAutoWidth = false;
            gridView1.ScrollStyle          = DevExpress.XtraGrid.Views.Grid.ScrollStyleFlags.LiveHorzScroll;
            gridView1.HorzScrollVisibility = DevExpress.XtraGrid.Views.Base.ScrollVisibility.Always;
            gridView1.Columns[0].Width     = 5;
            gridView1.Columns[1].Width     = 70;
            gridView1.Columns[2].Width     = 300;
            gridView1.Columns[3].Width     = 350;
            gridView1.Columns[4].Width     = 100;
            gridView1.Columns[5].Width     = 100;
            gridView1.Columns[6].Width     = 100;

            //Chèn dữ liệu vào gridcontrol

            string s1 = "SELECT COUNT(IDTC) as SoToChuc FROM TenTochuc";

            groupControl1.Text = "Danh sách tổ chức | Tổng số tổ chức : " + sql.GetData(s1, 0);

            DataColumn[] Array_col2 = { co0, co1, co2, co3, co4, co5, co6 };
            s1 = "SELECT ROW_NUMBER() OVER(ORDER BY [TenTochuc] ASC) AS Row#,[MaTochuc],[TenTochuc],[Diachi],[Masothue],[Giamdoc],convert(NVARCHAR, TenTochuc.NgayTL, 103) as NgayTL FROM [GIAODAT].[dbo].[TenTochuc]";
            table_DSToChuc.Clear();
            sql.ViewDataTable(s1, table_DSToChuc, Array_col2);


            Cursor = Cursors.Default;
        }
예제 #2
0
        private void F_Main_TenDuAn_Load(object sender, EventArgs e)
        {
            System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;

            sql   = F_DangNhap.SQL_con_object as SQLConnect;
            nguoi = F_DangNhap.person_object as NguoiDung;

            //GridControl DSTenToChuc
            table_DSTenDuAn = new DataTable();

            col0            = new DataColumn();
            col0.DataType   = System.Type.GetType("System.Int32");
            col0.ColumnName = "STT";
            table_DSTenDuAn.Columns.Add(col0);

            col1            = new DataColumn();
            col1.DataType   = System.Type.GetType("System.String");
            col1.ColumnName = "ID";
            table_DSTenDuAn.Columns.Add(col1);

            col2            = new DataColumn();
            col2.DataType   = System.Type.GetType("System.String");
            col2.ColumnName = "Tên dự án";
            table_DSTenDuAn.Columns.Add(col2);

            gridControl1.DataSource            = table_DSTenDuAn;
            gridView1.OptionsBehavior.Editable = false;
            //gridView1.OptionsView.ColumnAutoWidth = false;
            gridView1.Columns[0].Width = 20;
            gridView1.Columns[1].Width = 20;
            gridView1.Columns[2].Width = 200;

            DataColumn[] Array_col1 = { col0, col1, col2 };
            string       s          = "SELECT ROW_NUMBER() OVER(ORDER BY TenDuan asc) AS Row#,[IDGD],[TenDuan] FROM [GIAODAT].[dbo].[Giaodat]";

            sql.ViewDataTable(s, table_DSTenDuAn, Array_col1);


            //Gridcontrol2 Trươc giao

            table_Truoc           = new DataTable();
            col_truoc1            = new DataColumn();
            col_truoc1.DataType   = System.Type.GetType("System.String");
            col_truoc1.ColumnName = "Loại đất";
            table_Truoc.Columns.Add(col_truoc1);

            col_truoc2            = new DataColumn();
            col_truoc2.DataType   = Type.GetType("System.Double");
            col_truoc2.ColumnName = "Diện tích (m2)";
            table_Truoc.Columns.Add(col_truoc2);
            gridControl2.DataSource            = table_Truoc;
            gridView2.OptionsBehavior.Editable = false;
            gridView2.Columns[0].Width         = 150;


            //Gridcontrol3 Sau giao

            table_Sau           = new DataTable();
            col_sau1            = new DataColumn();
            col_sau1.DataType   = System.Type.GetType("System.String");
            col_sau1.ColumnName = "Loại đất";
            table_Sau.Columns.Add(col_sau1);

            col_sau2            = new DataColumn();
            col_sau2.DataType   = Type.GetType("System.Double");
            col_sau2.ColumnName = "Diện tích (m2)";
            table_Sau.Columns.Add(col_sau2);
            gridControl3.DataSource            = table_Sau;
            gridView3.OptionsBehavior.Editable = false;
            gridView3.Columns[0].Width         = 150;


            Cursor = Cursors.Default;
        }
예제 #3
0
        private void F_Main_DSachDiaDiem_Load(object sender, EventArgs e)
        {
            System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;

            sql   = F_DangNhap.SQL_con_object as SQLConnect;
            nguoi = F_DangNhap.person_object as NguoiDung;

            //GridControl DSDiaDiem
            table_DSDiaDiem = new DataTable();

            col0            = new DataColumn();
            col0.DataType   = System.Type.GetType("System.Int32");
            col0.ColumnName = "STT";
            table_DSDiaDiem.Columns.Add(col0);

            col1            = new DataColumn();
            col1.DataType   = System.Type.GetType("System.String");
            col1.ColumnName = "Mã";
            table_DSDiaDiem.Columns.Add(col1);

            col2            = new DataColumn();
            col2.DataType   = System.Type.GetType("System.String");
            col2.ColumnName = "Tên Huyện";
            table_DSDiaDiem.Columns.Add(col2);

            col3            = new DataColumn();
            col3.DataType   = System.Type.GetType("System.Int32");
            col3.ColumnName = "Số tổ chức";
            table_DSDiaDiem.Columns.Add(col3);

            col4            = new DataColumn();
            col4.DataType   = System.Type.GetType("System.Int32");
            col4.ColumnName = "Số dự án";
            table_DSDiaDiem.Columns.Add(col4);

            gridControl1.DataSource               = table_DSDiaDiem;
            gridView1.OptionsBehavior.Editable    = false;
            gridView1.OptionsView.ColumnAutoWidth = false;
            gridView1.Columns[0].Width            = 25;
            gridView1.Columns[1].Width            = 40;
            gridView1.Columns[2].Width            = 107;
            gridView1.Columns[3].Width            = 60;
            gridView1.Columns[4].Width            = 50;

            DataColumn[] Array_col1 = { col0, col1, col2, col3, col4 };
            string       s          = "SELECT ROW_NUMBER() OVER(ORDER BY t1.TenDvhc asc) AS Row#, t1.MaDvhc, t1.TenDvhc, ISNULL(t2.SoToChuc, 0 ) as SoToChuc, ISNULL(t2.SoDuAn, 0 ) as SoDuAn FROM (SELECT MaDvhc,TenDvhc FROM DMDvhc) t1 LEFT JOIN  (SELECT a.MaDvhc, a.SoDuAn , b.SoToChuc FROM (SELECT MaDvhc, COUNT(IDGD) as SoDuAn FROM Giaodat GROUP BY MaDvhc) a, (SELECT a.MaDvhc, COUNT(a.MaDvhc) as SoToChuc FROM (SELECT MaDvhc FROM Giaodat GROUP BY MaDvhc, MaTochuc) a GROUP BY a.MaDvhc) b WHERE a.MaDvhc=b.MaDvhc) t2 ON t1.MaDvhc = t2.MaDvhc";

            sql.ViewDataTable(s, table_DSDiaDiem, Array_col1);

            //Gridcontrol2 DSToChuc

            table_DSToChuc = new DataTable();

            co0            = new DataColumn();
            co0.DataType   = System.Type.GetType("System.Int32");
            co0.ColumnName = "STT";
            table_DSToChuc.Columns.Add(co0);

            co1            = new DataColumn();
            co1.DataType   = System.Type.GetType("System.String");
            co1.ColumnName = "Mã tổ chức";
            table_DSToChuc.Columns.Add(co1);

            co2            = new DataColumn();
            co2.DataType   = System.Type.GetType("System.String");
            co2.ColumnName = "Tên tổ chức";
            table_DSToChuc.Columns.Add(co2);

            co3            = new DataColumn();
            co3.DataType   = System.Type.GetType("System.Int32");
            co3.ColumnName = "Số dự án ở Huyện";
            table_DSToChuc.Columns.Add(co3);

            co4            = new DataColumn();
            co4.DataType   = System.Type.GetType("System.String");
            co4.ColumnName = "Địa chỉ";
            table_DSToChuc.Columns.Add(co4);

            co5            = new DataColumn();
            co5.DataType   = System.Type.GetType("System.String");
            co5.ColumnName = "Mã số thuế";
            table_DSToChuc.Columns.Add(co5);

            co6            = new DataColumn();
            co6.DataType   = System.Type.GetType("System.String");
            co6.ColumnName = "Giám đốc";
            table_DSToChuc.Columns.Add(co6);

            co7            = new DataColumn();
            co7.DataType   = System.Type.GetType("System.String");
            co7.ColumnName = "Ngày thành lập";
            table_DSToChuc.Columns.Add(co7);

            gridControl2.Width                    = int.MaxValue;
            gridControl2.DataSource               = table_DSToChuc;
            gridView2.OptionsBehavior.Editable    = false;
            gridView2.OptionsView.ColumnAutoWidth = false;
            gridView2.ScrollStyle                 = DevExpress.XtraGrid.Views.Grid.ScrollStyleFlags.LiveHorzScroll;
            gridView2.HorzScrollVisibility        = DevExpress.XtraGrid.Views.Base.ScrollVisibility.Always;
            gridView2.Columns[0].Width            = 25;
            gridView2.Columns[1].Width            = 70;
            gridView2.Columns[2].Width            = 300;
            gridView2.Columns[3].Width            = 110;
            gridView2.Columns[4].Width            = 350;
            gridView2.Columns[5].Width            = 100;
            gridView2.Columns[6].Width            = 100;
            gridView2.Columns[7].Width            = 100;


            //GridControl3 DSDuAn

            table_DSDuAn = new DataTable();

            c0            = new DataColumn();
            c0.DataType   = System.Type.GetType("System.Int32");
            c0.ColumnName = "STT";
            table_DSDuAn.Columns.Add(c0);

            c1            = new DataColumn();
            c1.DataType   = System.Type.GetType("System.String");
            c1.ColumnName = "Tên dự án";
            table_DSDuAn.Columns.Add(c1);

            c2            = new DataColumn();
            c2.DataType   = System.Type.GetType("System.String");
            c2.ColumnName = "Địa điểm";
            table_DSDuAn.Columns.Add(c2);

            c3            = new DataColumn();
            c3.DataType   = System.Type.GetType("System.String");
            c3.ColumnName = "Huyện";
            table_DSDuAn.Columns.Add(c3);

            c4            = new DataColumn();
            c4.DataType   = System.Type.GetType("System.Double");
            c4.ColumnName = "Diện tích trước giao (m2)";
            table_DSDuAn.Columns.Add(c4);

            c5            = new DataColumn();
            c5.DataType   = System.Type.GetType("System.Double");
            c5.ColumnName = "Diện tích sau giao (m2)";
            table_DSDuAn.Columns.Add(c5);

            c6            = new DataColumn();
            c6.DataType   = System.Type.GetType("System.String");
            c6.ColumnName = "Số quyết định";
            table_DSDuAn.Columns.Add(c6);

            c7            = new DataColumn();
            c7.DataType   = System.Type.GetType("System.String");
            c7.ColumnName = "Ngày quyết định";
            table_DSDuAn.Columns.Add(c7);

            c8            = new DataColumn();
            c8.DataType   = System.Type.GetType("System.String");
            c8.ColumnName = "Ngày giao";
            table_DSDuAn.Columns.Add(c8);

            c9            = new DataColumn();
            c9.DataType   = System.Type.GetType("System.String");
            c9.ColumnName = "Thời hạn";
            table_DSDuAn.Columns.Add(c9);

            c10            = new DataColumn();
            c10.DataType   = System.Type.GetType("System.String");
            c10.ColumnName = "Hình thức sử dụng";
            table_DSDuAn.Columns.Add(c10);

            c11            = new DataColumn();
            c11.DataType   = System.Type.GetType("System.String");
            c11.ColumnName = "Tình trạng pháp lý";
            table_DSDuAn.Columns.Add(c11);

            gridControl3.Width                    = int.MaxValue;
            gridControl3.DataSource               = table_DSDuAn;
            gridView3.OptionsBehavior.Editable    = false;
            gridView3.OptionsView.ColumnAutoWidth = false;
            gridView3.ScrollStyle                 = DevExpress.XtraGrid.Views.Grid.ScrollStyleFlags.LiveHorzScroll;
            gridView3.HorzScrollVisibility        = DevExpress.XtraGrid.Views.Base.ScrollVisibility.Always;
            gridView3.Columns[0].Width            = 25;
            gridView3.Columns[1].Width            = 300;
            gridView3.Columns[2].Width            = 250;
            gridView3.Columns[3].Width            = 110;
            gridView3.Columns[4].Width            = 130;
            gridView3.Columns[5].Width            = 120;
            gridView3.Columns[6].Width            = 90;
            gridView3.Columns[7].Width            = 90;
            gridView3.Columns[8].Width            = 70;
            gridView3.Columns[9].Width            = 70;
            gridView3.Columns[10].Width           = 300;
            gridView3.Columns[11].Width           = 150;


            Cursor = Cursors.Default;
        }
예제 #4
0
파일: F_XemDuAn.cs 프로젝트: taoqn/PMQLDD
        public F_XemDuAn(string soQD)
        {
            InitializeComponent();

            System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;

            sql   = F_DangNhap.SQL_con_object as SQLConnect;
            nguoi = F_DangNhap.person_object as NguoiDung;

            //Gridcontrol2 Trươc giao

            table_Truoc           = new DataTable();
            col_truoc1            = new DataColumn();
            col_truoc1.DataType   = System.Type.GetType("System.String");
            col_truoc1.ColumnName = "Loại đất";
            table_Truoc.Columns.Add(col_truoc1);

            col_truoc2            = new DataColumn();
            col_truoc2.DataType   = Type.GetType("System.Double");
            col_truoc2.ColumnName = "Diện tích (m2)";
            table_Truoc.Columns.Add(col_truoc2);
            gridControl2.DataSource            = table_Truoc;
            gridView2.OptionsBehavior.Editable = false;
            gridView2.Columns[0].Width         = 150;


            //Gridcontrol3 Sau giao

            table_Sau           = new DataTable();
            col_sau1            = new DataColumn();
            col_sau1.DataType   = System.Type.GetType("System.String");
            col_sau1.ColumnName = "Loại đất";
            table_Sau.Columns.Add(col_sau1);

            col_sau2            = new DataColumn();
            col_sau2.DataType   = Type.GetType("System.Double");
            col_sau2.ColumnName = "Diện tích (m2)";
            table_Sau.Columns.Add(col_sau2);
            gridControl3.DataSource            = table_Sau;
            gridView3.OptionsBehavior.Editable = false;
            gridView3.Columns[0].Width         = 150;

            // Chèn dữ liệu

            string s = "SELECT Giaodat.IDGD, Giaodat.TenDuan, Giaodat.Diadiem, DMDvhc.TenDvhc, Giaodat.SoQD, convert(NVARCHAR, Giaodat.NgayQD, 103) as NgayQD, convert(NVARCHAR, Giaodat.Ngaygiao, 103) as NgayGiao, convert(NVARCHAR, Giaodat.Thoihan, 103) as ThoiHan, DMHinhthucsudung.TenHinhthuc, Giaodat.TinhtrangPL, TenTochuc.TenTochuc, a.TongDTTruoc, b.TongDTDuoc FROM Giaodat, TenTochuc, DMDvhc, DMHinhthucsudung,( SELECT LDTruocGiao.IDGD, SUM(Dientich) as TongDTTruoc FROM LDTruocGiao, Giaodat WHERE Giaodat.IDGD = LDTruocGiao.IDGD GROUP BY LDTruocGiao.IDGD ) a, (SELECT LDDuocGiao.IDGD, SUM(Dientich) as TongDTDuoc FROM LDDuocGiao, Giaodat WHERE Giaodat.IDGD = LDDuocGiao.IDGD GROUP BY LDDuocGiao.IDGD) b WHERE Giaodat.SoQD='" + soQD + "' and Giaodat.MaTochuc = TenTochuc.MaTochuc and Giaodat.MaDvhc = DMDvhc.MaDvhc and Giaodat.MaHinhthuc = DMHinhthucsudung.MaHinhthuc and Giaodat.IDGD = a.IDGD and Giaodat.IDGD = b.IDGD";

            labelControl_Ma.Text        = sql.GetData(s, 0);
            labelControl_TenDA.Text     = sql.GetData(s, 1);
            labelControl_DiaDiem.Text   = sql.GetData(s, 2);
            labelControl_Huyen.Text     = sql.GetData(s, 3);
            labelControl_SoQD.Text      = sql.GetData(s, 4);
            labelControl_NgayQD.Text    = sql.GetData(s, 5);
            labelControl_NgayGiao.Text  = sql.GetData(s, 6);
            labelControl_ThoiHan.Text   = sql.GetData(s, 7);
            labelControl_HinhThuc.Text  = sql.GetData(s, 8);
            labelControl_TinhTrang.Text = sql.GetData(s, 9);
            labelControl_ToChuc.Text    = sql.GetData(s, 10);
            groupControl4.Text          = "Tổng diện tích trước giao : " + sql.GetData(s, 11) + " m2";
            groupControl5.Text          = "Tổng diện tích sau giao : " + sql.GetData(s, 12) + " m2";

            DataColumn[] Array_col2 = { col_truoc1, col_truoc2 };
            s = "SELECT DMLoaidat.TenLD,Dientich FROM DMLoaidat,LDTruocGiao WHERE LDTruocGiao.MaLD = DMLoaidat.MaLD and IDGD = " + labelControl_Ma.Text;
            table_Truoc.Clear();
            sql.ViewDataTable(s, table_Truoc, Array_col2);

            DataColumn[] Array_col3 = { col_sau1, col_sau2 };
            s = "SELECT DMLoaidat.TenLD,Dientich FROM DMLoaidat,LDDuocGiao WHERE LDDuocGiao.MaLD = DMLoaidat.MaLD and IDGD = " + labelControl_Ma.Text;
            table_Sau.Clear();
            sql.ViewDataTable(s, table_Sau, Array_col3);

            Cursor = Cursors.Default;
        }
예제 #5
0
        private void F_Main_TinhTrangPL_Load(object sender, EventArgs e)
        {
            System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;

            sql   = F_DangNhap.SQL_con_object as SQLConnect;
            nguoi = F_DangNhap.person_object as NguoiDung;

            //GridControl DSDuAn_DaCap
            table_DSDuAn_DaCap = new DataTable();

            c0            = new DataColumn();
            c0.DataType   = System.Type.GetType("System.Int32");
            c0.ColumnName = "STT";
            table_DSDuAn_DaCap.Columns.Add(c0);

            c1            = new DataColumn();
            c1.DataType   = System.Type.GetType("System.String");
            c1.ColumnName = "Tên dự án";
            table_DSDuAn_DaCap.Columns.Add(c1);

            c2            = new DataColumn();
            c2.DataType   = System.Type.GetType("System.String");
            c2.ColumnName = "Địa điểm";
            table_DSDuAn_DaCap.Columns.Add(c2);

            c3            = new DataColumn();
            c3.DataType   = System.Type.GetType("System.String");
            c3.ColumnName = "Huyện";
            table_DSDuAn_DaCap.Columns.Add(c3);

            c4            = new DataColumn();
            c4.DataType   = System.Type.GetType("System.Double");
            c4.ColumnName = "Diện tích trước giao (m2)";
            table_DSDuAn_DaCap.Columns.Add(c4);

            c5            = new DataColumn();
            c5.DataType   = System.Type.GetType("System.Double");
            c5.ColumnName = "Diện tích sau giao (m2)";
            table_DSDuAn_DaCap.Columns.Add(c5);

            c6            = new DataColumn();
            c6.DataType   = System.Type.GetType("System.String");
            c6.ColumnName = "Số quyết định";
            table_DSDuAn_DaCap.Columns.Add(c6);

            c7            = new DataColumn();
            c7.DataType   = System.Type.GetType("System.String");
            c7.ColumnName = "Ngày quyết định";
            table_DSDuAn_DaCap.Columns.Add(c7);

            c8            = new DataColumn();
            c8.DataType   = System.Type.GetType("System.String");
            c8.ColumnName = "Ngày giao";
            table_DSDuAn_DaCap.Columns.Add(c8);

            c9            = new DataColumn();
            c9.DataType   = System.Type.GetType("System.String");
            c9.ColumnName = "Thời hạn";
            table_DSDuAn_DaCap.Columns.Add(c9);

            c10            = new DataColumn();
            c10.DataType   = System.Type.GetType("System.String");
            c10.ColumnName = "Hình thức sử dụng";
            table_DSDuAn_DaCap.Columns.Add(c10);

            c11            = new DataColumn();
            c11.DataType   = System.Type.GetType("System.String");
            c11.ColumnName = "Tình trạng pháp lý";
            table_DSDuAn_DaCap.Columns.Add(c11);

            gridControl1.Width                    = int.MaxValue;
            gridControl1.DataSource               = table_DSDuAn_DaCap;
            gridView1.OptionsBehavior.Editable    = false;
            gridView1.OptionsView.ColumnAutoWidth = false;
            gridView1.ScrollStyle                 = DevExpress.XtraGrid.Views.Grid.ScrollStyleFlags.LiveHorzScroll;
            gridView1.HorzScrollVisibility        = DevExpress.XtraGrid.Views.Base.ScrollVisibility.Always;
            gridView1.Columns[0].Width            = 25;
            gridView1.Columns[1].Width            = 300;
            gridView1.Columns[2].Width            = 250;
            gridView1.Columns[3].Width            = 110;
            gridView1.Columns[4].Width            = 130;
            gridView1.Columns[5].Width            = 120;
            gridView1.Columns[6].Width            = 90;
            gridView1.Columns[7].Width            = 90;
            gridView1.Columns[8].Width            = 70;
            gridView1.Columns[9].Width            = 70;
            gridView1.Columns[10].Width           = 300;
            gridView1.Columns[11].Width           = 150;

            // Chèn dữ liệu đã cấp

            string daCap = "SELECT COUNT(TinhtrangPL) as SoDuAn FROM Giaodat WHERE TinhtrangPL = N'Đã cấp giấy chứng nhận'";

            groupControl1.Text = "Danh sách dự án  |  Tổng số dự án đã cấp giấy chứng nhận : " + sql.GetData(daCap, 0);

            DataColumn[] Array_col2 = { c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11 };
            string       s1         = "SELECT ROW_NUMBER() OVER(ORDER BY Giaodat.TenDuan asc) AS Row#, Giaodat.TenDuan, Giaodat.Diadiem, DMDvhc.TenDvhc, a.TongDTTruoc, b.TongDTDuoc, Giaodat.SoQD, convert(NVARCHAR, Giaodat.NgayQD, 103) as NgayQD, convert(NVARCHAR, Giaodat.Ngaygiao, 103) as NgayGiao, convert(NVARCHAR, Giaodat.Thoihan, 103) as ThoiHan, DMHinhthucsudung.TenHinhthuc, Giaodat.TinhtrangPL FROM Giaodat, DMDvhc, DMHinhthucsudung,( SELECT LDTruocGiao.IDGD, SUM(Dientich) as TongDTTruoc FROM LDTruocGiao, Giaodat WHERE Giaodat.IDGD = LDTruocGiao.IDGD GROUP BY LDTruocGiao.IDGD ) a, (SELECT LDDuocGiao.IDGD, SUM(Dientich) as TongDTDuoc FROM LDDuocGiao, Giaodat WHERE Giaodat.IDGD = LDDuocGiao.IDGD GROUP BY LDDuocGiao.IDGD) b WHERE Giaodat.TinhtrangPL = N'Đã cấp giấy chứng nhận' and Giaodat.MaDvhc = DMDvhc.MaDvhc and Giaodat.MaHinhthuc = DMHinhthucsudung.MaHinhthuc and Giaodat.IDGD = a.IDGD and Giaodat.IDGD = b.IDGD GROUP BY Giaodat.TenDuan, Giaodat.Diadiem, a.TongDTTruoc, b.TongDTDuoc, DMDvhc.TenDvhc, Giaodat.SoQD, Giaodat.NgayQD, Giaodat.Ngaygiao, Giaodat.Thoihan, DMHinhthucsudung.TenHinhthuc, Giaodat.TinhtrangPL";

            table_DSDuAn_DaCap.Clear();
            sql.ViewDataTable(s1, table_DSDuAn_DaCap, Array_col2);


            //GridControl DSDuAn_ChuaCap
            table_DSDuAn_ChuaCap = new DataTable();

            c0            = new DataColumn();
            c0.DataType   = System.Type.GetType("System.Int32");
            c0.ColumnName = "STT";
            table_DSDuAn_ChuaCap.Columns.Add(c0);

            c1            = new DataColumn();
            c1.DataType   = System.Type.GetType("System.String");
            c1.ColumnName = "Tên dự án";
            table_DSDuAn_ChuaCap.Columns.Add(c1);

            c2            = new DataColumn();
            c2.DataType   = System.Type.GetType("System.String");
            c2.ColumnName = "Địa điểm";
            table_DSDuAn_ChuaCap.Columns.Add(c2);

            c3            = new DataColumn();
            c3.DataType   = System.Type.GetType("System.String");
            c3.ColumnName = "Huyện";
            table_DSDuAn_ChuaCap.Columns.Add(c3);

            c4            = new DataColumn();
            c4.DataType   = System.Type.GetType("System.Double");
            c4.ColumnName = "Diện tích trước giao (m2)";
            table_DSDuAn_ChuaCap.Columns.Add(c4);

            c5            = new DataColumn();
            c5.DataType   = System.Type.GetType("System.Double");
            c5.ColumnName = "Diện tích sau giao (m2)";
            table_DSDuAn_ChuaCap.Columns.Add(c5);

            c6            = new DataColumn();
            c6.DataType   = System.Type.GetType("System.String");
            c6.ColumnName = "Số quyết định";
            table_DSDuAn_ChuaCap.Columns.Add(c6);

            c7            = new DataColumn();
            c7.DataType   = System.Type.GetType("System.String");
            c7.ColumnName = "Ngày quyết định";
            table_DSDuAn_ChuaCap.Columns.Add(c7);

            c8            = new DataColumn();
            c8.DataType   = System.Type.GetType("System.String");
            c8.ColumnName = "Ngày giao";
            table_DSDuAn_ChuaCap.Columns.Add(c8);

            c9            = new DataColumn();
            c9.DataType   = System.Type.GetType("System.String");
            c9.ColumnName = "Thời hạn";
            table_DSDuAn_ChuaCap.Columns.Add(c9);

            c10            = new DataColumn();
            c10.DataType   = System.Type.GetType("System.String");
            c10.ColumnName = "Hình thức sử dụng";
            table_DSDuAn_ChuaCap.Columns.Add(c10);

            c11            = new DataColumn();
            c11.DataType   = System.Type.GetType("System.String");
            c11.ColumnName = "Tình trạng pháp lý";
            table_DSDuAn_ChuaCap.Columns.Add(c11);

            gridControl2.Width                    = int.MaxValue;
            gridControl2.DataSource               = table_DSDuAn_ChuaCap;
            gridView2.OptionsBehavior.Editable    = false;
            gridView2.OptionsView.ColumnAutoWidth = false;
            gridView2.ScrollStyle                 = DevExpress.XtraGrid.Views.Grid.ScrollStyleFlags.LiveHorzScroll;
            gridView2.HorzScrollVisibility        = DevExpress.XtraGrid.Views.Base.ScrollVisibility.Always;
            gridView2.Columns[0].Width            = 25;
            gridView2.Columns[1].Width            = 300;
            gridView2.Columns[2].Width            = 250;
            gridView2.Columns[3].Width            = 110;
            gridView2.Columns[4].Width            = 130;
            gridView2.Columns[5].Width            = 120;
            gridView2.Columns[6].Width            = 90;
            gridView2.Columns[7].Width            = 90;
            gridView2.Columns[8].Width            = 70;
            gridView2.Columns[9].Width            = 70;
            gridView2.Columns[10].Width           = 300;
            gridView2.Columns[11].Width           = 150;

            // Chèn dữ liệu chưa cấp

            string chuaCap = "SELECT COUNT(TinhtrangPL) as SoDuAn FROM Giaodat WHERE TinhtrangPL = N'Chưa cấp giấy chứng nhận'";

            groupControl2.Text = "Danh sách dự án  |  Tổng số dự án chưa cấp giấy chứng nhận : " + sql.GetData(chuaCap, 0);

            DataColumn[] Array_col3 = { c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11 };
            string       s2         = "SELECT ROW_NUMBER() OVER(ORDER BY Giaodat.TenDuan asc) AS Row#, Giaodat.TenDuan, Giaodat.Diadiem, DMDvhc.TenDvhc, a.TongDTTruoc, b.TongDTDuoc, Giaodat.SoQD, convert(NVARCHAR, Giaodat.NgayQD, 103) as NgayQD, convert(NVARCHAR, Giaodat.Ngaygiao, 103) as NgayGiao, convert(NVARCHAR, Giaodat.Thoihan, 103) as ThoiHan, DMHinhthucsudung.TenHinhthuc, Giaodat.TinhtrangPL FROM Giaodat, DMDvhc, DMHinhthucsudung,( SELECT LDTruocGiao.IDGD, SUM(Dientich) as TongDTTruoc FROM LDTruocGiao, Giaodat WHERE Giaodat.IDGD = LDTruocGiao.IDGD GROUP BY LDTruocGiao.IDGD ) a, (SELECT LDDuocGiao.IDGD, SUM(Dientich) as TongDTDuoc FROM LDDuocGiao, Giaodat WHERE Giaodat.IDGD = LDDuocGiao.IDGD GROUP BY LDDuocGiao.IDGD) b WHERE Giaodat.TinhtrangPL = N'Chưa cấp giấy chứng nhận' and Giaodat.MaDvhc = DMDvhc.MaDvhc and Giaodat.MaHinhthuc = DMHinhthucsudung.MaHinhthuc and Giaodat.IDGD = a.IDGD and Giaodat.IDGD = b.IDGD GROUP BY Giaodat.TenDuan, Giaodat.Diadiem, a.TongDTTruoc, b.TongDTDuoc, DMDvhc.TenDvhc, Giaodat.SoQD, Giaodat.NgayQD, Giaodat.Ngaygiao, Giaodat.Thoihan, DMHinhthucsudung.TenHinhthuc, Giaodat.TinhtrangPL";

            table_DSDuAn_ChuaCap.Clear();
            sql.ViewDataTable(s2, table_DSDuAn_ChuaCap, Array_col3);

            Cursor = Cursors.Default;
        }
예제 #6
0
        private void F_Main_TiepNhanHoSo_Load(object sender, EventArgs e)
        {
            sql   = F_DangNhap.SQL_con_object as SQLConnect;
            nguoi = F_DangNhap.person_object as NguoiDung;

            //Lookupedit Huyen
            DataTable  table_Huyen = new DataTable();
            DataColumn col1        = new DataColumn();

            col1.DataType   = System.Type.GetType("System.String");
            col1.ColumnName = "Mã";
            table_Huyen.Columns.Add(col1);

            DataColumn col2 = new DataColumn();

            col2.DataType   = System.Type.GetType("System.String");
            col2.ColumnName = "Đơn vị";
            table_Huyen.Columns.Add(col2);

            lookUpEdit_Huyen.Properties.DataSource    = table_Huyen;
            lookUpEdit_Huyen.Properties.DisplayMember = "Đơn vị";
            lookUpEdit_Huyen.Properties.ValueMember   = "Mã";

            DataColumn[] Array_col1 = { col1, col2 };
            string       s1         = "SELECT [MaDvhc],[TenDvhc] FROM [GIAODAT].[dbo].[DMDvhc] ORDER BY TenDvhc asc";

            sql.ViewDataTable(s1, table_Huyen, Array_col1);

            //Lookupedit Hình thức sử dụng

            DataTable  table_HinhThucSuDung = new DataTable();
            DataColumn column1 = new DataColumn();

            column1.DataType   = System.Type.GetType("System.String");
            column1.ColumnName = "Mã";
            table_HinhThucSuDung.Columns.Add(column1);

            DataColumn column2 = new DataColumn();

            column2.DataType   = System.Type.GetType("System.String");
            column2.ColumnName = "Hình thức";
            table_HinhThucSuDung.Columns.Add(column2);

            lookUpEdit_HinhThuc.Properties.DataSource    = table_HinhThucSuDung;
            lookUpEdit_HinhThuc.Properties.DisplayMember = "Hình thức";
            lookUpEdit_HinhThuc.Properties.ValueMember   = "Mã";

            DataColumn[] Array_col2 = { column1, column2 };
            string       s2         = "SELECT [MaHinhthuc],[TenHinhthuc] FROM [GIAODAT].[dbo].[DMHinhthucsudung] ORDER BY TenHinhthuc asc";

            sql.ViewDataTable(s2, table_HinhThucSuDung, Array_col2);

            //Lookupedit Tình trạng pháp lý

            DataTable  table_TinhTrangPL = new DataTable();
            DataColumn cot = new DataColumn();

            cot.DataType   = System.Type.GetType("System.String");
            cot.ColumnName = "Tình trạng";
            table_TinhTrangPL.Columns.Add(cot);

            lookUpEdit_TinhTrangPL.Properties.DataSource    = table_TinhTrangPL;
            lookUpEdit_TinhTrangPL.Properties.DisplayMember = "Tình trạng";
            lookUpEdit_TinhTrangPL.Properties.ValueMember   = "Tình trạng";

            table_TinhTrangPL.BeginLoadData();
            DataRow row = table_TinhTrangPL.NewRow();

            row[0] = "Đã cấp giấy chứng nhận";
            table_TinhTrangPL.Rows.Add(row);
            row    = table_TinhTrangPL.NewRow();
            row[0] = "Chưa cấp giấy chứng nhận";
            table_TinhTrangPL.Rows.Add(row);
            table_TinhTrangPL.EndLoadData();


            //Lookupedit Loai đất

            DataTable  table_LoaiDat = new DataTable();
            DataColumn col_loaidat1  = new DataColumn();

            col_loaidat1.DataType   = System.Type.GetType("System.String");
            col_loaidat1.ColumnName = "Mã";
            table_LoaiDat.Columns.Add(col_loaidat1);

            DataColumn col_loaidat2 = new DataColumn();

            col_loaidat2.DataType   = System.Type.GetType("System.String");
            col_loaidat2.ColumnName = "Loại đất";
            table_LoaiDat.Columns.Add(col_loaidat2);

            DataColumn[] Array_col3 = { col_loaidat1, col_loaidat2 };
            string       s3         = "SELECT [MaLD],[TenLD] FROM [GIAODAT].[dbo].[DMLoaidat] ORDER BY TenLD asc";

            sql.ViewDataTable(s3, table_LoaiDat, Array_col3);


            //Gridcontrol Trươc giao

            table_Truoc = new DataTable();
            DataColumn col_truoc1 = new DataColumn();

            col_truoc1.DataType   = System.Type.GetType("System.String");
            col_truoc1.ColumnName = "Loại đất";
            table_Truoc.Columns.Add(col_truoc1);

            DataColumn col_truoc2 = new DataColumn();

            col_truoc2.DataType   = Type.GetType("System.Double");
            col_truoc2.ColumnName = "Diện tích (m2)";
            table_Truoc.Columns.Add(col_truoc2);
            gridControl1.DataSource = table_Truoc;

            RepositoryItemLookUpEdit riLookup1 = new RepositoryItemLookUpEdit();

            riLookup1.DataSource            = table_LoaiDat;
            riLookup1.DisplayMember         = "Loại đất";
            riLookup1.ValueMember           = "Mã";
            gridView1.Columns[0].ColumnEdit = riLookup1;
            gridView1.Columns[0].Width      = 200;

            //Gridcontrol Sau giao

            table_Sau = new DataTable();
            DataColumn col_sau1 = new DataColumn();

            col_sau1.DataType   = System.Type.GetType("System.String");
            col_sau1.ColumnName = "Loại đất";
            table_Sau.Columns.Add(col_sau1);

            DataColumn col_sau2 = new DataColumn();

            col_sau2.DataType   = Type.GetType("System.Double");
            col_sau2.ColumnName = "Diện tích (m2)";
            table_Sau.Columns.Add(col_sau2);
            gridControl2.DataSource = table_Sau;

            RepositoryItemLookUpEdit riLookup2 = new RepositoryItemLookUpEdit();

            riLookup2.DataSource            = table_LoaiDat;
            riLookup2.DisplayMember         = "Loại đất";
            riLookup2.ValueMember           = "Mã";
            gridView2.Columns[0].ColumnEdit = riLookup2;
            gridView2.Columns[0].Width      = 200;
        }
예제 #7
0
 public F_Main_ThemToChuc()
 {
     InitializeComponent();
     sql   = F_DangNhap.SQL_con_object as SQLConnect;
     nguoi = F_DangNhap.person_object as NguoiDung;
 }
예제 #8
0
        private void F_Main_QuyetDinh_Load(object sender, EventArgs e)
        {
            System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;

            sql   = F_DangNhap.SQL_con_object as SQLConnect;
            nguoi = F_DangNhap.person_object as NguoiDung;

            //GridControl DSTenToChuc
            table_DSQuyetDinh = new DataTable();

            col0            = new DataColumn();
            col0.DataType   = System.Type.GetType("System.Int32");
            col0.ColumnName = "STT";
            table_DSQuyetDinh.Columns.Add(col0);

            col1            = new DataColumn();
            col1.DataType   = System.Type.GetType("System.String");
            col1.ColumnName = "Số quyết định";
            table_DSQuyetDinh.Columns.Add(col1);

            col2            = new DataColumn();
            col2.DataType   = System.Type.GetType("System.String");
            col2.ColumnName = "Ngày quyết định";
            table_DSQuyetDinh.Columns.Add(col2);

            gridControl1.DataSource               = table_DSQuyetDinh;
            gridView1.OptionsBehavior.Editable    = false;
            gridView1.OptionsView.ColumnAutoWidth = true;
            gridView1.Columns[0].Width            = 25;
            //gridView1.Columns[1].Width = 275;

            DataColumn[] Array_col1 = { col0, col1, col2 };
            string       s          = "SELECT ROW_NUMBER() OVER(ORDER BY [NgayQD] DESC) AS Row#,[SoQD],convert(NVARCHAR,[NgayQD],103) as Ngay FROM [GIAODAT].[dbo].[Giaodat] ";

            sql.ViewDataTable(s, table_DSQuyetDinh, Array_col1);


            //Gridcontrol2 Trươc giao

            table_Truoc           = new DataTable();
            col_truoc1            = new DataColumn();
            col_truoc1.DataType   = System.Type.GetType("System.String");
            col_truoc1.ColumnName = "Loại đất";
            table_Truoc.Columns.Add(col_truoc1);

            col_truoc2            = new DataColumn();
            col_truoc2.DataType   = Type.GetType("System.Double");
            col_truoc2.ColumnName = "Diện tích (m2)";
            table_Truoc.Columns.Add(col_truoc2);
            gridControl2.DataSource            = table_Truoc;
            gridView2.OptionsBehavior.Editable = false;
            gridView2.Columns[0].Width         = 150;

            //Gridcontrol3 Sau giao

            table_Sau           = new DataTable();
            col_sau1            = new DataColumn();
            col_sau1.DataType   = System.Type.GetType("System.String");
            col_sau1.ColumnName = "Loại đất";
            table_Sau.Columns.Add(col_sau1);

            col_sau2            = new DataColumn();
            col_sau2.DataType   = Type.GetType("System.Double");
            col_sau2.ColumnName = "Diện tích (m2)";
            table_Sau.Columns.Add(col_sau2);
            gridControl3.DataSource            = table_Sau;
            gridView3.OptionsBehavior.Editable = false;
            gridView3.Columns[0].Width         = 150;

            Cursor = Cursors.Default;
        }
예제 #9
0
        private void F_Main_NguonGocDat_Load(object sender, EventArgs e)
        {
            System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;

            sql   = F_DangNhap.SQL_con_object as SQLConnect;
            nguoi = F_DangNhap.person_object as NguoiDung;

            //GridControl DSDiaDiem
            table_DSNguonGocDat = new DataTable();
            col1            = new DataColumn();
            col1.DataType   = System.Type.GetType("System.String");
            col1.ColumnName = "Mã";
            table_DSNguonGocDat.Columns.Add(col1);

            col2            = new DataColumn();
            col2.DataType   = System.Type.GetType("System.String");
            col2.ColumnName = "Tên loại đất";
            table_DSNguonGocDat.Columns.Add(col2);

            col3            = new DataColumn();
            col3.DataType   = System.Type.GetType("System.Int32");
            col3.ColumnName = "Số dự án";
            table_DSNguonGocDat.Columns.Add(col3);

            col4            = new DataColumn();
            col4.DataType   = System.Type.GetType("System.Double");
            col4.ColumnName = "Tổng diện tích (m2)";
            table_DSNguonGocDat.Columns.Add(col4);

            gridControl1.DataSource               = table_DSNguonGocDat;
            gridView1.OptionsBehavior.Editable    = false;
            gridView1.OptionsView.ColumnAutoWidth = false;
            gridView1.Columns[0].Width            = 40;
            gridView1.Columns[1].Width            = 200;
            gridView1.Columns[2].Width            = 60;
            gridView1.Columns[3].Width            = 100;

            DataColumn[] Array_col1 = { col1, col2, col3, col4 };
            string       s          = "SELECT t1.MaLD,t1.TenLD,ISNULL(t2.SoDuAn, 0 ) as DuAn,ISNULL(t2.TongDT, 0 ) as DT FROM (SELECT MaLD,TenLD FROM DMLoaidat) t1 LEFT JOIN (SELECT a.MaLD, COUNT(a.IDGD) as SoDuAn, SUM(a.DT) as TongDT FROM (SELECT IDGD,MaLD, SUM(Dientich) as DT FROM LDTruocGiao GROUP BY IDGD,MaLD) a GROUP BY a.MaLD) t2 ON t1.MaLD = t2.MaLD ORDER BY DuAn desc";

            sql.ViewDataTable(s, table_DSNguonGocDat, Array_col1);


            //GridControl2 DSDuAn

            table_DSDuAn = new DataTable();

            c0            = new DataColumn();
            c0.DataType   = System.Type.GetType("System.Int32");
            c0.ColumnName = "STT";
            table_DSDuAn.Columns.Add(c0);

            c1            = new DataColumn();
            c1.DataType   = System.Type.GetType("System.String");
            c1.ColumnName = "Tên dự án";
            table_DSDuAn.Columns.Add(c1);

            c2            = new DataColumn();
            c2.DataType   = System.Type.GetType("System.String");
            c2.ColumnName = "Địa điểm";
            table_DSDuAn.Columns.Add(c2);

            c3            = new DataColumn();
            c3.DataType   = System.Type.GetType("System.String");
            c3.ColumnName = "Huyện";
            table_DSDuAn.Columns.Add(c3);

            c3_5            = new DataColumn();
            c3_5.DataType   = System.Type.GetType("System.Double");
            c3_5.ColumnName = "Diện tích theo nguồn gốc đất (m2)";
            table_DSDuAn.Columns.Add(c3_5);

            c4            = new DataColumn();
            c4.DataType   = System.Type.GetType("System.Double");
            c4.ColumnName = "Diện tích trước giao (m2)";
            table_DSDuAn.Columns.Add(c4);

            c5            = new DataColumn();
            c5.DataType   = System.Type.GetType("System.Double");
            c5.ColumnName = "Diện tích sau giao (m2)";
            table_DSDuAn.Columns.Add(c5);

            c6            = new DataColumn();
            c6.DataType   = System.Type.GetType("System.String");
            c6.ColumnName = "Số quyết định";
            table_DSDuAn.Columns.Add(c6);

            c7            = new DataColumn();
            c7.DataType   = System.Type.GetType("System.String");
            c7.ColumnName = "Ngày quyết định";
            table_DSDuAn.Columns.Add(c7);

            c8            = new DataColumn();
            c8.DataType   = System.Type.GetType("System.String");
            c8.ColumnName = "Ngày giao";
            table_DSDuAn.Columns.Add(c8);

            c9            = new DataColumn();
            c9.DataType   = System.Type.GetType("System.String");
            c9.ColumnName = "Thời hạn";
            table_DSDuAn.Columns.Add(c9);

            c10            = new DataColumn();
            c10.DataType   = System.Type.GetType("System.String");
            c10.ColumnName = "Hình thức sử dụng";
            table_DSDuAn.Columns.Add(c10);

            c11            = new DataColumn();
            c11.DataType   = System.Type.GetType("System.String");
            c11.ColumnName = "Tình trạng pháp lý";
            table_DSDuAn.Columns.Add(c11);

            gridControl2.Width                    = int.MaxValue;
            gridControl2.DataSource               = table_DSDuAn;
            gridView2.OptionsBehavior.Editable    = false;
            gridView2.OptionsView.ColumnAutoWidth = false;
            gridView2.ScrollStyle                 = DevExpress.XtraGrid.Views.Grid.ScrollStyleFlags.LiveHorzScroll;
            gridView2.HorzScrollVisibility        = DevExpress.XtraGrid.Views.Base.ScrollVisibility.Always;
            gridView2.Columns[0].Width            = 25;
            gridView2.Columns[1].Width            = 300;
            gridView2.Columns[2].Width            = 250;
            gridView2.Columns[3].Width            = 110;
            gridView2.Columns[4].Width            = 170;
            gridView2.Columns[5].Width            = 130;
            gridView2.Columns[6].Width            = 120;
            gridView2.Columns[7].Width            = 90;
            gridView2.Columns[8].Width            = 90;
            gridView2.Columns[9].Width            = 70;
            gridView2.Columns[10].Width           = 70;
            gridView2.Columns[11].Width           = 320;
            gridView2.Columns[12].Width           = 150;

            Cursor = Cursors.Default;
        }
예제 #10
0
        private void F_Main_TenToChuc_Load(object sender, EventArgs e)
        {
            System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;


            sql   = F_DangNhap.SQL_con_object as SQLConnect;
            nguoi = F_DangNhap.person_object as NguoiDung;

            //GridControl DSTenToChuc
            table_DSTenToChuc = new DataTable();

            col0            = new DataColumn();
            col0.DataType   = System.Type.GetType("System.Int32");
            col0.ColumnName = "STT";
            table_DSTenToChuc.Columns.Add(col0);

            col1            = new DataColumn();
            col1.DataType   = System.Type.GetType("System.String");
            col1.ColumnName = "Mã TC";
            table_DSTenToChuc.Columns.Add(col1);

            col2            = new DataColumn();
            col2.DataType   = System.Type.GetType("System.String");
            col2.ColumnName = "Tên tổ chức";
            table_DSTenToChuc.Columns.Add(col2);

            col3            = new DataColumn();
            col3.DataType   = System.Type.GetType("System.Int32");
            col3.ColumnName = "Số dự án";
            table_DSTenToChuc.Columns.Add(col3);

            gridControl1.DataSource            = table_DSTenToChuc;
            gridView1.OptionsBehavior.Editable = false;
            gridView1.Columns[0].Width         = 5;
            gridView1.Columns[1].Width         = 20;
            gridView1.Columns[2].Width         = 70;
            gridView1.Columns[3].Width         = 20;

            DataColumn[] Array_col1 = { col0, col1, col2, col3 };
            string       s          = "SELECT ROW_NUMBER() OVER(ORDER BY t1.TenTochuc asc) AS Row#,t1.MaTochuc,t1.TenTochuc,ISNULL(t2.soduan, 0 ) as SoDuAn FROM (Select MaTochuc,TenTochuc from TenTochuc) t1  LEFT JOIN  (Select MaTochuc, COUNT(MaTochuc) as soduan from Giaodat group by MaTochuc) t2 ON t1.MaTochuc = t2.MaTochuc WHERE t2.soduan IS NULL OR t2.soduan >= 0";

            sql.ViewDataTable(s, table_DSTenToChuc, Array_col1);


            //GridControl DSDuAn
            table_DSDuAn = new DataTable();

            c0            = new DataColumn();
            c0.DataType   = System.Type.GetType("System.Int32");
            c0.ColumnName = "STT";
            table_DSDuAn.Columns.Add(c0);

            c1            = new DataColumn();
            c1.DataType   = System.Type.GetType("System.String");
            c1.ColumnName = "Tên dự án";
            table_DSDuAn.Columns.Add(c1);

            c2            = new DataColumn();
            c2.DataType   = System.Type.GetType("System.String");
            c2.ColumnName = "Địa điểm";
            table_DSDuAn.Columns.Add(c2);

            c3            = new DataColumn();
            c3.DataType   = System.Type.GetType("System.String");
            c3.ColumnName = "Huyện";
            table_DSDuAn.Columns.Add(c3);

            c4            = new DataColumn();
            c4.DataType   = System.Type.GetType("System.Double");
            c4.ColumnName = "Diện tích trước giao (m2)";
            table_DSDuAn.Columns.Add(c4);

            c5            = new DataColumn();
            c5.DataType   = System.Type.GetType("System.Double");
            c5.ColumnName = "Diện tích sau giao (m2)";
            table_DSDuAn.Columns.Add(c5);

            c6            = new DataColumn();
            c6.DataType   = System.Type.GetType("System.String");
            c6.ColumnName = "Số quyết định";
            table_DSDuAn.Columns.Add(c6);

            c7            = new DataColumn();
            c7.DataType   = System.Type.GetType("System.String");
            c7.ColumnName = "Ngày quyết định";
            table_DSDuAn.Columns.Add(c7);

            c8            = new DataColumn();
            c8.DataType   = System.Type.GetType("System.String");
            c8.ColumnName = "Ngày giao";
            table_DSDuAn.Columns.Add(c8);

            c9            = new DataColumn();
            c9.DataType   = System.Type.GetType("System.String");
            c9.ColumnName = "Thời hạn";
            table_DSDuAn.Columns.Add(c9);

            c10            = new DataColumn();
            c10.DataType   = System.Type.GetType("System.String");
            c10.ColumnName = "Hình thức sử dụng";
            table_DSDuAn.Columns.Add(c10);

            c11            = new DataColumn();
            c11.DataType   = System.Type.GetType("System.String");
            c11.ColumnName = "Tình trạng pháp lý";
            table_DSDuAn.Columns.Add(c11);

            gridControl2.Width                    = int.MaxValue;
            gridControl2.DataSource               = table_DSDuAn;
            gridView2.OptionsBehavior.Editable    = false;
            gridView2.OptionsView.ColumnAutoWidth = false;
            gridView2.ScrollStyle                 = DevExpress.XtraGrid.Views.Grid.ScrollStyleFlags.LiveHorzScroll;
            gridView2.HorzScrollVisibility        = DevExpress.XtraGrid.Views.Base.ScrollVisibility.Always;
            gridView2.Columns[0].Width            = 25;
            gridView2.Columns[1].Width            = 300;
            gridView2.Columns[2].Width            = 250;
            gridView2.Columns[3].Width            = 110;
            gridView2.Columns[4].Width            = 130;
            gridView2.Columns[5].Width            = 120;
            gridView2.Columns[6].Width            = 90;
            gridView2.Columns[7].Width            = 90;
            gridView2.Columns[8].Width            = 70;
            gridView2.Columns[9].Width            = 70;
            gridView2.Columns[10].Width           = 300;
            gridView2.Columns[11].Width           = 150;


            Cursor = Cursors.Default;
        }
예제 #11
0
        private void F_Main_ThoiHanSuDung_Load(object sender, EventArgs e)
        {
            System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;

            sql   = F_DangNhap.SQL_con_object as SQLConnect;
            nguoi = F_DangNhap.person_object as NguoiDung;

            //GridControl2 DSDuAn

            table_DSDuAn = new DataTable();

            c0            = new DataColumn();
            c0.DataType   = System.Type.GetType("System.Int32");
            c0.ColumnName = "STT";
            table_DSDuAn.Columns.Add(c0);

            c1            = new DataColumn();
            c1.DataType   = System.Type.GetType("System.String");
            c1.ColumnName = "Tên dự án";
            table_DSDuAn.Columns.Add(c1);

            c2            = new DataColumn();
            c2.DataType   = System.Type.GetType("System.String");
            c2.ColumnName = "Ngày giao";
            table_DSDuAn.Columns.Add(c2);

            c3            = new DataColumn();
            c3.DataType   = System.Type.GetType("System.String");
            c3.ColumnName = "Hết hạn";
            table_DSDuAn.Columns.Add(c3);

            c4            = new DataColumn();
            c4.DataType   = System.Type.GetType("System.String");
            c4.ColumnName = "Còn lại";
            table_DSDuAn.Columns.Add(c4);

            //c5 = new DataColumn();
            //c5.DataType = System.Type.GetType("System.String");
            //c5.ColumnName = "Số tháng còn lại khoảng";
            //table_DSDuAn.Columns.Add(c5);

            c6            = new DataColumn();
            c6.DataType   = System.Type.GetType("System.String");
            c6.ColumnName = "Địa điểm";
            table_DSDuAn.Columns.Add(c6);

            c7            = new DataColumn();
            c7.DataType   = System.Type.GetType("System.String");
            c7.ColumnName = "Mã huyện";
            table_DSDuAn.Columns.Add(c7);

            c8            = new DataColumn();
            c8.DataType   = System.Type.GetType("System.String");
            c8.ColumnName = "Số quyết định";
            table_DSDuAn.Columns.Add(c8);

            c9            = new DataColumn();
            c9.DataType   = System.Type.GetType("System.String");
            c9.ColumnName = "Ngày quyết định";
            table_DSDuAn.Columns.Add(c9);

            c10            = new DataColumn();
            c10.DataType   = System.Type.GetType("System.String");
            c10.ColumnName = "Hình thức sử dụng";
            table_DSDuAn.Columns.Add(c10);

            c11            = new DataColumn();
            c11.DataType   = System.Type.GetType("System.String");
            c11.ColumnName = "Tình trạng pháp lý";
            table_DSDuAn.Columns.Add(c11);

            gridControl1.Width                    = int.MaxValue;
            gridControl1.DataSource               = table_DSDuAn;
            gridView1.OptionsBehavior.Editable    = false;
            gridView1.OptionsView.ColumnAutoWidth = false;
            gridView1.ScrollStyle                 = DevExpress.XtraGrid.Views.Grid.ScrollStyleFlags.LiveHorzScroll;
            gridView1.HorzScrollVisibility        = DevExpress.XtraGrid.Views.Base.ScrollVisibility.Always;

            gridView1.Columns[0].Width = 25;
            gridView1.Columns[1].Width = 350;
            gridView1.Columns[2].Width = 90;
            gridView1.Columns[3].Width = 90;
            gridView1.Columns[4].Width = 120;
            //gridView1.Columns[5].Width = 150;
            gridView1.Columns[5].Width  = 250;
            gridView1.Columns[6].Width  = 110;
            gridView1.Columns[7].Width  = 90;
            gridView1.Columns[8].Width  = 90;
            gridView1.Columns[9].Width  = 370;
            gridView1.Columns[10].Width = 200;


            this.ShowAllData(-1);

            Cursor = Cursors.Default;
        }