示例#1
0
 public static void CarregarASPxGridView( DevExpress.Web.ASPxGridView.ASPxGridView aspxgridview, System.Data.DataTable table)
 {
     aspxgridview.AutoGenerateColumns = true;
     aspxgridview.DataSource = table;
     //aspxgridview.KeyFieldName = "#";
     aspxgridview.DataBind();
 }
 private void RefreshGrid(DevExpress.Web.ASPxGridView.ASPxGridView gv)
 {
     gv.DataSource = Business.MediosPublicitarios.ReadAllGrupo("");
     gv.DataBind();
 }
示例#3
0
        public static void InitListPhieuYeuCau(DevExpress.Web.ASPxGridLookup.ASPxGridLookup gridLookup, bool? IsAdd)
        {
            //DevExpress.Web.ASPxGridView.GridViewDataTextColumn colMa = new DevExpress.Web.ASPxGridView.GridViewDataTextColumn();
            //colMa.Caption = "Mã dự án";
            //colMa.FieldName = DA_DU_AN.cl_MA_DU_AN;
            DataTable dtYC = YC_YEU_CAU.GetTable(@"SELECT yc.YEU_CAU_ID,
            yc.TIEU_DE,yc.NGAY_YEU_CAU,
            lyc.TEN_LOAI_YC,
            ttyc.[NAME] TRANG_THAI_YC,
            nd.[NAME] NGUOI_YC,yc.NGUOI_YEU_CAU
            FROM YC_YEU_CAU yc
            LEFT JOIN ND_THONG_TIN_ND nd ON nd.ID=yc.NGUOI_YEU_CAU
            LEFT JOIN YC_DM_LOAI_YEU_CAU lyc ON lyc.ID=yc.LOAI_YC_ID
            LEFT JOIN YC_DM_TRANG_THAI_YEU_CAU ttyc ON ttyc.ID = yc.TRANG_THAI_ID", YC_YEU_CAU.sTableName
            );
            DevExpress.Web.ASPxGridView.GridViewDataTextColumn colTieuDe = new DevExpress.Web.ASPxGridView.GridViewDataTextColumn();
            colTieuDe.Caption = "Phiếu yêu cầu";
            colTieuDe.FieldName = YC_YEU_CAU.cl_TIEU_DE;

            DevExpress.Web.ASPxGridView.GridViewDataDateColumn colNgayYC = new DevExpress.Web.ASPxGridView.GridViewDataDateColumn();
            colNgayYC.Caption = "Ngày yêu cầu";
            colNgayYC.FieldName = YC_YEU_CAU.cl_NGAY_YEU_CAU;

            DevExpress.Web.ASPxGridView.GridViewDataTextColumn colNguoiYC = new DevExpress.Web.ASPxGridView.GridViewDataTextColumn();
            colNguoiYC.Caption = "Người yêu cầu";
            colNguoiYC.FieldName = "NGUOI_YC";

            DevExpress.Web.ASPxGridView.GridViewDataTextColumn colLoaiYC = new DevExpress.Web.ASPxGridView.GridViewDataTextColumn();
            colLoaiYC.Caption = "Loại yêu cầu";
            colLoaiYC.FieldName = "TEN_LOAI_YC";

            DevExpress.Web.ASPxGridView.GridViewDataTextColumn colTTYC = new DevExpress.Web.ASPxGridView.GridViewDataTextColumn();
            colLoaiYC.Caption = "Trạng thái";
            colLoaiYC.FieldName = "TRANG_THAI_YC";

            DevExpress.Web.ASPxGridView.GridViewDataTextColumn colID = new DevExpress.Web.ASPxGridView.GridViewDataTextColumn();
            colID.Caption = "ID";
            colID.FieldName = YC_YEU_CAU.cl_YEU_CAU_ID;
            colID.Visible = false;

            DevExpress.Web.ASPxGridView.GridViewDataTextColumn colNguoiYCID = new DevExpress.Web.ASPxGridView.GridViewDataTextColumn();
            colNguoiYCID.Caption = "NGUOI_YC_ID";
            colNguoiYCID.FieldName = YC_YEU_CAU.cl_NGUOI_YEU_CAU;
            colNguoiYCID.Visible = false;

            gridLookup.Columns.Clear();
            gridLookup.Columns.Add(colTieuDe);
            gridLookup.Columns.Add(colNgayYC);
            gridLookup.Columns.Add(colNguoiYC);
            gridLookup.Columns.Add(colLoaiYC);
            gridLookup.Columns.Add(colTTYC);
            gridLookup.Columns.Add(colID);
            gridLookup.Columns.Add(colNguoiYCID);
             //   gridLookup.GridView.Settings.ShowFilterRow = true;
            AddEmptyRow(dtYC, YC_YEU_CAU.cl_YEU_CAU_ID);
            gridLookup.DataSource = dtYC;
            gridLookup.KeyFieldName = YC_YEU_CAU.cl_YEU_CAU_ID;
            gridLookup.DataBind();
        }
示例#4
0
        public static void InitListDuAn(DevExpress.Web.ASPxGridLookup.ASPxGridLookup gridLookup, bool? IsAdd)
        {
            DevExpress.Web.ASPxGridView.GridViewDataTextColumn colMa = new DevExpress.Web.ASPxGridView.GridViewDataTextColumn();
            colMa.Caption = "Mã dự án";
            colMa.FieldName = DA_DU_AN.cl_MA_DU_AN;

            DevExpress.Web.ASPxGridView.GridViewDataTextColumn colTenDA = new DevExpress.Web.ASPxGridView.GridViewDataTextColumn();
            colTenDA.Caption = "Tên dự án";
            colTenDA.FieldName = DA_DU_AN.cl_TEN_DU_AN;

            DevExpress.Web.ASPxGridView.GridViewDataDateColumn colNgayTao = new DevExpress.Web.ASPxGridView.GridViewDataDateColumn();
            colNgayTao.Caption = "Ngày tạo";
            colNgayTao.FieldName = DA_DU_AN.cl_NGAY_TAO;

            DevExpress.Web.ASPxGridView.GridViewDataDateColumn colNgayBD = new DevExpress.Web.ASPxGridView.GridViewDataDateColumn();
            colNgayBD.Caption = "Ngày bắt đầu";
            colNgayBD.FieldName = DA_DU_AN.cl_NGAY_BAT_DAU;

            DevExpress.Web.ASPxGridView.GridViewDataDateColumn colNgayKT = new DevExpress.Web.ASPxGridView.GridViewDataDateColumn();
            colNgayKT.Caption = "Ngày kết thúc";
            colNgayKT.FieldName = DA_DU_AN.cl_NGAY_KET_THUC;

            DataTable dtTrangThai = DA_DM_TRANG_THAI_DU_AN.GetTableAll();
            DevExpress.Web.ASPxGridView.GridViewDataComboBoxColumn colTrangThai = new DevExpress.Web.ASPxGridView.GridViewDataComboBoxColumn();
            colTrangThai.PropertiesComboBox.DataSource = dtTrangThai;
            colTrangThai.PropertiesComboBox.ValueField = DA_DM_TRANG_THAI_DU_AN.cl_ID;
            colTrangThai.PropertiesComboBox.TextField = DA_DM_TRANG_THAI_DU_AN.cl_NAME;
            colTrangThai.Caption = "Trạng thái dự án";
            colTrangThai.FieldName = DA_DU_AN.cl_TRANG_THAI_ID;

            DevExpress.Web.ASPxGridView.GridViewDataTextColumn colID = new DevExpress.Web.ASPxGridView.GridViewDataTextColumn();
            colID.Caption = "ID";
            colID.FieldName = DA_DU_AN.cl_ID;
            colID.Visible = false;

            gridLookup.Columns.Clear();
            gridLookup.Columns.Add(colMa);
            gridLookup.Columns.Add(colTenDA);
            gridLookup.Columns.Add(colNgayTao);
            gridLookup.Columns.Add(colNgayBD);
            gridLookup.Columns.Add(colNgayKT);
            gridLookup.Columns.Add(colTrangThai);
            gridLookup.Columns.Add(colID);

              //  gridLookup.GridView.Settings.ShowFilterRow = true;

            DataTable dtDA= DA_DU_AN.GetTableAll();
            AddEmptyRow(dtDA, DA_DU_AN.cl_ID);
            gridLookup.DataSource = dtDA;
            gridLookup.KeyFieldName = DA_DU_AN.cl_ID;
            gridLookup.DataBind();
        }
示例#5
0
        public static void InitGridLookup(DevExpress.Web.ASPxGridLookup.ASPxGridLookup gridLookup,
            DataTable dtSource, string ValueField, string DisplayField, string[] Columns, string[] Caption)
        {
            AddEmptyRow(dtSource, ValueField);
            if (Columns != null && Columns.Length > 0)
            {
                if (Caption == null) Caption = new string[0];

                for (int i = 0; i < Columns.Length; i++)
                {
                    DevExpress.Web.ASPxGridView.GridViewDataTextColumn col = new DevExpress.Web.ASPxGridView.GridViewDataTextColumn();
                    col.Caption = i < Caption.Length ? Caption[i] : Columns[i];
                    col.FieldName = Columns[i];
                    gridLookup.Columns.Add(col);

                }
            }
            gridLookup.KeyFieldName = ValueField;

            gridLookup.DataSource = dtSource;
            gridLookup.DataBind();
        }
示例#6
0
 /// <summary>
 /// Khởi tạo datasoucre cho control ASPxComboBox
 /// </summary>
 /// <param name="cbo"></param>
 /// <param name="dtSource"></param>
 /// <param name="ValueField"></param>
 /// <param name="DislpayField"></param>
 public static void InitCombobox(DevExpress.Web.ASPxEditors.ASPxComboBox cbo,
     DataTable dtSource, string ValueField, string DislpayField)
 {
     AddEmptyRow(dtSource, ValueField);
     cbo.DataSource = dtSource;
     cbo.ValueField = ValueField;
     cbo.TextField = DislpayField;
     cbo.DataBind();
 }
示例#7
0
 private void UpdateEventChart(DevExpress.XtraCharts.Web.WebChartControl wc, int rsch)
 {
     int r = rsch;
     int virtualTime = 0;
     wc.Series.Clear();
     var evts = ResearchManager.GetEventsSignByRschId(r);
     ArrayList fDS = new ArrayList();
     ArrayList rDS = new ArrayList();
     ArrayList pDS = new ArrayList();
     ArrayList sDS = new ArrayList();
     foreach (var evt in evts)
     {
         virtualTime++;
         switch (evt.module)
         {
             case 1:
                 fDS.Add(new Record(virtualTime, evt.significance, evt.significance + 1));
                 break;
             case 2:
                 rDS.Add(new Record(virtualTime, evt.significance, evt.significance + 1));
                 break;
             case 3:
                 pDS.Add(new Record(virtualTime, evt.significance, evt.significance + 1));
                 break;
             case 4:
             case 5:
                 sDS.Add(new Record(virtualTime, evt.significance, evt.significance + 1));
                 break;
         }
     }
     Series fseries = new Series("Файловая система", ViewType.SideBySideRangeBar);
     Series rseries = new Series("Реестр", ViewType.SideBySideRangeBar);
     Series pseries = new Series("Процессы", ViewType.SideBySideRangeBar);
     Series sseries = new Series("Сеть", ViewType.SideBySideRangeBar);
     wc.Series.Add(fseries);
     wc.Series.Add(rseries);
     wc.Series.Add(pseries);
     wc.Series.Add(sseries);
     ((SideBySideRangeBarSeriesView)fseries.View).Color = Color.FromArgb(75, 89, 97);
     ((SideBySideRangeBarSeriesView)fseries.View).FillStyle.FillMode = FillMode.Solid;
     ((SideBySideRangeBarSeriesView)rseries.View).Color = Color.FromArgb(37, 119, 147);
     ((SideBySideRangeBarSeriesView)rseries.View).FillStyle.FillMode = FillMode.Solid;
     ((SideBySideRangeBarSeriesView)pseries.View).Color = Color.FromArgb(242, 148, 65);
     ((SideBySideRangeBarSeriesView)pseries.View).FillStyle.FillMode = FillMode.Solid;
     ((SideBySideRangeBarSeriesView)sseries.View).Color = Color.FromArgb(206, 72, 34);
     ((SideBySideRangeBarSeriesView)sseries.View).FillStyle.FillMode = FillMode.Solid;
     if (fDS.Count > 0) fseries.DataSource = fDS;
     fseries.ArgumentScaleType = ScaleType.Numerical;
     fseries.ValueScaleType = ScaleType.Numerical;
     fseries.ValueDataMembers[0] = "startv";
     fseries.ValueDataMembers[1] = "endv";
     fseries.ArgumentDataMember = "id";
     rseries.ArgumentScaleType = ScaleType.Numerical;
     rseries.ValueScaleType = ScaleType.Numerical;
     rseries.ValueDataMembers[0] = "startv";
     rseries.ValueDataMembers[1] = "endv";
     rseries.ArgumentDataMember = "id";
     if (rDS.Count > 0) rseries.DataSource = rDS;
     pseries.ArgumentScaleType = ScaleType.Numerical;
     pseries.ValueScaleType = ScaleType.Numerical;
     pseries.ValueDataMembers[0] = "startv";
     pseries.ValueDataMembers[1] = "endv";
     pseries.ArgumentDataMember = "id";
     if (pDS.Count > 0) pseries.DataSource = pDS;
     sseries.ArgumentScaleType = ScaleType.Numerical;
     sseries.ValueScaleType = ScaleType.Numerical;
     sseries.ValueDataMembers[0] = "startv";
     sseries.ValueDataMembers[1] = "endv";
     sseries.ArgumentDataMember = "id";
     if (sDS.Count > 0) sseries.DataSource = sDS;
     wc.DataBind();
 }