示例#1
0
        private void LoadDataBychiphitcID(string id)
        {
            try
            {
                string query = "exec proc_ShowCTCP_by_chiphiID @chiphitcID='" + id + "'";
                gridControl2.DataSource = DataProvider.Instance.ExecuteQuery(query);
                if (gridView2.Columns.Count > 1)
                {
                    gridView2.Columns[2].DisplayFormat.FormatType   = FormatType.DateTime;
                    gridView2.Columns[2].DisplayFormat.FormatString = "d/M/yyyy";

                    gridView2.Columns[7].DisplayFormat.FormatType   = DevExpress.Utils.FormatType.Custom;
                    gridView2.Columns[7].DisplayFormat.FormatString = "n0";
                    gridView2.Columns[8].DisplayFormat.FormatType   = DevExpress.Utils.FormatType.Custom;
                    gridView2.Columns[8].DisplayFormat.FormatString = "n0";
                }

                DisableEditColumnsGridView.CustomEditColumnsGridView(gridView2, new int[] { 0, 1, 2, 3 });
                AddUnboundColumn2();
                AddRepository2();
            }
            catch (SqlException ex)
            {
                MessageBox.Show("lỗi ngoại lệ: " + ex + ". Liên hệ Trung: 0902669115");
            }
        }
示例#2
0
        public void LoadCDT()
        {
            string query = "exec proc_ShowCDT";

            gridControl1.DataSource = DataProvider.Instance.ExecuteQuery(query);

            DisableEditColumnsGridView.CustomEditColumnsGridView(gridView1, new int[] { 0 });
        }
示例#3
0
        private void gridView1_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e)
        {
            var id = (sender as GridView).GetFocusedRowCellValue("doanhthuID");

            //textEdit1.EditValue = (sender as GridView).GetFocusedRowCellValue("chiphiID");
            //MessageBox.Show("ok,"+abc);
            LoadDataByDoanhThuID((int)id);
            DisableEditColumnsGridView.CustomEditColumnsGridView(gridView2, new int[] { 0, 1, 2 });
        }
示例#4
0
        public void LoadDoanhThu()
        {
            string query = "exec proc_ShowDoanhThu";

            gridControl1.DataSource = DataProvider.Instance.ExecuteQuery(query);
            //format show datetime show in gridview
            if (gridView1.Columns.Count > 1)
            {
                gridView1.Columns[1].DisplayFormat.FormatType   = FormatType.DateTime;
                gridView1.Columns[1].DisplayFormat.FormatString = "d/M/yyyy";
            }
            DisableEditColumnsGridView.CustomEditColumnsGridView(gridView1, new int[] { 0, 1 });
        }
        public void LoadCTCDT_CPTC()
        {
            string query = "exec [dbo].[proc_ShowCDT_CPTC]";

            gridControl1.DataSource = DataProvider.Instance.ExecuteQuery(query);

            CultureInfo cultureInfo = new CultureInfo("vi-VN");

            //for mat số tiền lấy thành vnd
            if (gridView1.Columns.Count > 1)
            {
                gridView1.Columns[6].DisplayFormat.FormatType   = DevExpress.Utils.FormatType.Custom;
                gridView1.Columns[6].DisplayFormat.FormatString = "n0";
                //string a = double.Parse("12345").ToString("#,###", cultureInfo.NumberFormat);
            }
            DisableEditColumnsGridView.CustomEditColumnsGridView(gridView1, new int[] { 0, 1, 2, 3, 4, 5 });
        }
示例#6
0
        void LoadDataChiPhi()
        {
            string query = "exec proc_ShowChiPhi";

            gridControl1.DataSource = DataProvider.Instance.ExecuteQuery(query);
            //format show datetime show in gridview
            if (gridView1.Columns.Count > 1)
            {
                gridView1.Columns[2].DisplayFormat.FormatType   = FormatType.DateTime;
                gridView1.Columns[2].DisplayFormat.FormatString = "d/M/yyyy";
            }
            AddUnboundColumn();
            AddRepository();
            CustomCellMergeColumnGridView();
            //CustomCellMergeColumnGridView customCellMergeColumnGrid = new CustomCellMergeColumnGridView(gridView1, "ngaytapcp");
            //customCellMergeColumnGrid.CellMergeColumnGridViewTienCC();
            DisableEditColumnsGridView.CustomEditColumnsGridView(gridView1, new int[] { 0, 1, 2, 3 });
        }
        public void LoadDataTienConLaiTheoCa()
        {
            string query = "exec [dbo].[proc_ShowTienConLaiTheoCa]";

            gridControl1.DataSource = DataProvider.Instance.ExecuteQuery(query);

            //format show datetime show in gridview
            if (gridView1.Columns.Count > 1)
            {
                gridView1.Columns[2].DisplayFormat.FormatType   = FormatType.DateTime;
                gridView1.Columns[2].DisplayFormat.FormatString = "d/M/yyyy";
                gridView1.Columns[4].DisplayFormat.FormatType   = DevExpress.Utils.FormatType.Custom;
                gridView1.Columns[4].DisplayFormat.FormatString = "n0";
            }
            AddUnboundColumn();
            AddRepository();
            DisableEditColumnsGridView.CustomEditColumnsGridView(gridView1, new int[] { 0, 1, 2, 3, 4 });
        }
        public void LoadDoanhThuTheoCa()
        {
            string query = "exec proc_ShowDoanhThuTheoCa";

            gridControl1.DataSource = DataProvider.Instance.ExecuteQuery(query);
            if (gridView1.Columns.Count > 1)
            {
                gridView1.Columns[2].DisplayFormat.FormatType   = FormatType.DateTime;
                gridView1.Columns[2].DisplayFormat.FormatString = "d/M/yyyy";
                gridView1.Columns[4].DisplayFormat.FormatType   = DevExpress.Utils.FormatType.Custom;
                gridView1.Columns[4].DisplayFormat.FormatString = "n0";
                gridView1.Columns[5].DisplayFormat.FormatType   = DevExpress.Utils.FormatType.Custom;
                gridView1.Columns[5].DisplayFormat.FormatString = "n0";
                gridView1.Columns[6].DisplayFormat.FormatType   = DevExpress.Utils.FormatType.Custom;
                gridView1.Columns[6].DisplayFormat.FormatString = "n0";
            }

            //CustomCellMergeColumnGridView();
            DisableEditColumnsGridView.CustomEditColumnsGridView(gridView1, new int[] { 0, 1, 2 });
        }
示例#9
0
        public void LoadCTCP()
        {
            string query = "exec proc_ShowCTCPTC";

            gridControl1.DataSource = DataProvider.Instance.ExecuteQuery(query);
            //format show datetime show in gridview
            if (gridView1.Columns.Count > 1)
            {
                gridView1.Columns[4].DisplayFormat.FormatType   = FormatType.DateTime;
                gridView1.Columns[4].DisplayFormat.FormatString = "d/M/yyyy";

                gridView1.Columns[7].DisplayFormat.FormatType   = DevExpress.Utils.FormatType.Custom;
                gridView1.Columns[7].DisplayFormat.FormatString = "n0";
                gridView1.Columns[8].DisplayFormat.FormatType   = DevExpress.Utils.FormatType.Custom;
                gridView1.Columns[8].DisplayFormat.FormatString = "n0";
            }
            //CustomCellMergeColumnGridView();
            CustomCellMergeColumnGridView customCellMergeColumnGrid = new CustomCellMergeColumnGridView(gridView1, "ngaytaocp");

            customCellMergeColumnGrid.CellMergeColumnGridViewDTTC();

            DisableEditColumnsGridView.CustomEditColumnsGridView(gridView1, new int[] { 0, 1, 2, 3 });
        }