Exemple #1
2
 /// <summary>Phương thức cho phép thêm chức năng vào cho Cột
 /// Khi thay đổi giá trị của cột nó làm ảnh hưởng giá trị của các
 /// cột khác
 /// </summary>
 /// <param name="Column">Cột mã hàng</param>
 /// <param name="FieldName">FieldName của Tên hàng hóa, đơn giá, giảm giá ...</param>
 /// <param name="func">Hàm gán giá trị cho các field</param>
 public static void AddCalcGridColum(GridView Grid, GridColumn Column, string[] FieldNames, GetInfo Func)
 {
     Grid.CellValueChanged += delegate(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
     {
         try
         {
             GridView grid = (GridView)sender;
             DataRow row = grid.GetDataRow(grid.FocusedRowHandle);
             if (e.Column.FieldName.Equals(Column.FieldName))
             {
                 object[] Values = Func(row[Column.FieldName]);
                 if (Values != null)
                 {
                     for (int i = 0; i < FieldNames.Length; i++)
                     {
                         grid.SetRowCellValue(grid.FocusedRowHandle, FieldNames[i], Values[i]);
                     }
                 }
                 else
                 {
                     grid.DeleteRow(grid.FocusedRowHandle);
                 }
             }
         }
         catch (Exception ex)
         {
             PLException.AddException(ex);
         }
     };
 }
        public void TestGridFilterHeaderRenderer()
        {
            var settings = new QueryStringFilterSettings();
            var renderer = new QueryStringFilterColumnHeaderRenderer(settings);

            var column = new GridColumn<TestModel, string>(c => c.Title, new TestGrid(Enumerable.Empty<TestModel>()));

            var htmlstring = renderer.Render(column);
            Assert.IsNotNull(htmlstring);
            var html = htmlstring.ToHtmlString();
            Assert.IsTrue(string.IsNullOrEmpty(html));

            column.Filterable(true);

            htmlstring = renderer.Render(column);
            Assert.IsNotNull(htmlstring);
            html = htmlstring.ToHtmlString();

            Assert.IsTrue(!string.IsNullOrWhiteSpace(html));

            Assert.IsTrue(html.Contains("data-filterdata="));
            Assert.IsTrue(html.Contains("class=\"grid-filter\""));
            Assert.IsTrue(html.Contains("class=\"grid-filter-btn\""));
            Assert.IsTrue(html.Contains("data-widgetdata="));
        }
        private void BindData()
        {
            _data.Clear();
            _data.Add(_projectModel.FreqByDirs.ToArray());
            _data.AddRange(_projectModel.FreqByBins);
            _data.Add(_projectModel.MeanVelocityPerDir.ToArray());

            grid.Columns.Clear();
            var titleCol = new GridColumn();
            titleCol.UnboundType = UnboundColumnType.String;
            titleCol.ReadOnly = true;
            titleCol.FieldName = String.Format("Title");
            titleCol.Header = "#";
            titleCol.Width = 70;
            titleCol.Tag = -1;
            grid.Columns.Add(titleCol);

            for (var dirIdx = 0; dirIdx < _projectModel.NDirs; dirIdx++)
            {
                var col = new GridColumn();
                col.UnboundType = UnboundColumnType.Decimal;
                col.ReadOnly = true;
                col.FieldName = String.Format("ColumnN{0}", dirIdx);
                col.Header = String.Format("{0}", (360/_projectModel.NDirs)*dirIdx);
                col.Tag = dirIdx;
                col.Width = 70;
                grid.Columns.Add(col);
            }

            grid.ItemsSource = null;
            grid.ItemsSource = _data;
        }
        public Table GenerateTable(List<string> colwidths, List<string> headers)
        {
            this.colwidths = colwidths;
            Table table1 = new Table();

            TableProperties tableProperties1 = new TableProperties();
            TableWidth tableWidth1 = new TableWidth() { Width = "8750", Type = TableWidthUnitValues.Dxa };
            TableLayout tableLayout1 = new TableLayout() { Type = TableLayoutValues.Fixed };
            TableIndentation tableIndentation1 = new TableIndentation() { Width = 108, Type = TableWidthUnitValues.Dxa };
            TableLook tableLook1 = new TableLook() { Val = "04A0" };

            tableProperties1.Append(tableWidth1);
            tableProperties1.Append(tableIndentation1);
            tableProperties1.Append(tableLayout1);
            tableProperties1.Append(tableLook1);

            TableGrid tableGrid1 = new TableGrid();
            GridColumn gridColumn;

            foreach (string cw in colwidths) {
                gridColumn = new GridColumn() { Width = cw };
                tableGrid1.Append(gridColumn);
            }

            TableRow headerRow = generateHeaderRow(headers);
            table1.Append(tableProperties1);
            table1.Append(tableGrid1);
            table1.Append(headerRow);

            return table1;
        }
 protected override DataTable UpdateDatasource(DataTable dtSource)
 {
     dtSource.DefaultView.RowFilter = GroupTypeEqualExpression(SummaryRow);
     var dtAvgView = dtSource.DefaultView.ToTable().DefaultView;
     dtAvgView.Sort = "rate desc";
     dtSource.DefaultView.RowFilter = "";
     var dtRpt = dtSource.DefaultView.ToTable(true,ColGroupType, ColTimeband);
     dtRpt.PrimaryKey = new[] {dtRpt.Columns[ColGroupType], dtRpt.Columns[ColTimeband] };
     int index = 1;
     foreach (DataRowView row in dtAvgView)
     {
         var idKenh = row["KENH_PHAT"];
         dtSource.DefaultView.RowFilter = "KENH_PHAT=" + idKenh;
         var dtByKenh = dtSource.DefaultView.ToTable(true,ColGroupType, ColTimeband, "RATE");
         var fiedName = "RATE_" + idKenh;
         dtByKenh.Columns["RATE"].ColumnName = fiedName;
         dtRpt.Merge(dtByKenh);
         var col = new GridColumn
         {
             Name = "ColRate_" + idKenh,
             Caption = row["KENH_PHAT_NAME"].ToString(),
             Visible = true
         };
         GridViewDetail.Columns.Add(col);
         HelpGridColumn.CotCalcEdit(col, fiedName, 1);
         col.OptionsColumn.AllowMove = false;
         col.OptionsColumn.AllowSort = DefaultBoolean.False;
         col.VisibleIndex = index;
         index++;
     }
     var dss = new DataSet();
     dss.Tables.Add(dtRpt);
     return dtRpt;
 }
 public override void InitColumnMaster()
 {
     XtraGridSupportExt.TextLeftColumn(Cotloai_cv, "TEN_CV");
     XtraGridSupportExt.TextLeftColumn(CotCTCCV_ID, "CTCCV_ID");
     XtraGridSupportExt.TextLeftColumn(Cotmota, "MO_TA");
     HelpGridColumn.CotPLTimeEdit(Cotthoigian, "THOI_GIAN_THUC_HIEN", PLConst.FORMAT_TIME_HH_MM);
     HelpGridColumn.CotPLTimeEdit(cotngaylamviec, "NGAY_LAM_VIEC", "ddd, dd/MM/yyyy");
     HelpGridColumn.CotReadOnlyDate(CotNgaycapnhat, "NGAY_CAP_NHAT", PLConst.FORMAT_DATETIME_STRING);
     XtraGridSupportExt.TextLeftColumn(cotnhanvien, "NHANVIEN");
     GridColumn column = new GridColumn();
     //XtraGridSupportExt.CreateDuyetGridColumn(column);
     this.gridViewMaster.Columns.Add(column);
     this.cotnhanvien.Visible = false;
     this.cotngaylamviec.Visible = false;
     gridViewMaster.OptionsView.ShowGroupPanel = false;
     //Nếu ngày cập nhật > ngày làm việc 1 ngày -> Đỏ
     StyleFormatCondition condition = new StyleFormatCondition();
     condition.Appearance.Options.UseForeColor = true;
     condition.Appearance.ForeColor = Color.Red;
     condition.Condition = FormatConditionEnum.Expression;
     condition.Expression = string.Format(@"(AddDays(AddTimeSpan([NGAY_LAM_VIEC],#{0}#),1) <= [NGAY_CAP_NHAT])", new TimeSpan(0, 0, 1));
     condition.ApplyToRow = true;
     gridViewMaster.FormatConditions.Add(condition);
     //-----------------------------
 }
		private static Rectangle CalcSummaryRect(string text, RowObjectCustomDrawEventArgs e, GridColumn column)
		{
			var gridInfo = column.View.GetViewInfo() as GridViewInfo;
			var result = GetColumnBounds(column);
			SizeF sz = TextUtils.GetStringSize(e.Graphics, text, e.Appearance.Font);
			var width = Convert.ToInt32(sz.Width) + 1;
			if (!gridInfo.ViewRects.FixedLeft.IsEmpty)
			{
				var fixedLeftRight = gridInfo.ViewRects.FixedLeft.Right;
				var marginLeft = result.Right - width - fixedLeftRight;
				if (marginLeft < 0 && column.Fixed == FixedStyle.None)
					return Rectangle.Empty;
			}
			if (!gridInfo.ViewRects.FixedRight.IsEmpty)
			{
				var fixedRightLeft = gridInfo.ViewRects.FixedRight.Left;
				if (fixedRightLeft <= result.Right && column.Fixed == FixedStyle.None)
					return Rectangle.Empty;
			}
			result = FixLeftEdge(width, result);
			result.Width = result.Width;
			result.Y = e.Bounds.Y;
			result.Height = e.Bounds.Height - 2;

			return PreventSummaryTextOverlapping(e, result);
		}
 /// <summary>Hàm này chỉ dùng khi cột tính toán chỉ cần hiển thị không có lưu trữ 
 /// </summary>
 public static void AddCalc(GridView gridView, ref GridColumn ResultColumn, string[] FieldNames, ProtocolVN.Framework.Win.RowInteraction.GridColumnFunction func)
 {
     RowInteraction grid = new RowInteraction(gridView);
     gridView.CustomUnboundColumnData += new DevExpress.XtraGrid.Views.Base.CustomColumnDataEventHandler(grid.gridView_CustomUnboundColumnDataCalc);
     ResultColumn.UnboundType = DevExpress.Data.UnboundColumnType.Object;
     grid.AddCalcHelp(null, ResultColumn, FieldNames, func);
 }
Exemple #9
0
 public static RepositoryItemCalcEdit CotCalcEditDec(GridColumn Column, string ColumnField, int SoThapPhan, decimal Min, decimal Max, bool AllowNULL)
 {
     RepositoryItemCalcEdit repos = CotCalcEditInt(Column, ColumnField, Min, Max, AllowNULL);
     ApplyFormatAction.applyElement(repos, SoThapPhan);
     HelpGridColumn.SetSummaryNumFormat(Column, SoThapPhan);
     return repos;
 }
            public void Should_map_the_constructor_parameters_to_the_right_properties()
            {
                var rows = new List<string>
                           {
                               "Row1",
                               "Row2"
                           };

                const GridColumnType gridColumnType = GridColumnType.Sortable;
                const string columnheader = "ColumnHeader";
                const string fieldname = "FieldName";
                var left = AlignAttribute.Left;
                const string actionname = "ActionName";
                IGridColumn gridColumn = new GridColumn(gridColumnType, columnheader, fieldname, left, true, false, "", actionname, rows);

                gridColumn.Type.ShouldBeEqualTo(gridColumnType);
                gridColumn.ColumnHeader.ShouldBeEqualTo(columnheader);
                gridColumn.FieldName.ShouldBeEqualTo(fieldname);
                gridColumn.Align.ShouldBeEqualTo(left);
                gridColumn.IsDefaultSortColumn.ShouldBeTrue();
                gridColumn.IsClientSideSortable.ShouldBeFalse();
                gridColumn.ActionName.ShouldBeEqualTo(actionname);
                gridColumn.Count.ShouldBeEqualTo(rows.Count);
                gridColumn[0].ShouldBeEqualTo(rows[0]);
                gridColumn[1].ShouldBeEqualTo(rows[1]);
            }
 /// <summary>
 /// Initialises a new instance of the <see cref="SetGridColumnColourMessage"/> class.
 /// </summary>
 /// <param name="driverId">The Id of the driver the message is related to.</param>
 /// <param name="column">The column whose value is to be set.</param>
 /// <param name="colour">The column colour value.</param>
 public SetGridColumnColourMessage(int driverId, GridColumn column,
     GridColumnColour colour)
     : base(driverId)
 {
     Column = column;
     Colour = colour;
 }
Exemple #12
0
 /// <summary>
 /// Ẩn thông tin tính toán của 1 nhóm trên Grid
 /// </summary>
 /// <param name="grid">GridView</param>
 /// <param name="column">GridColumn</param>            
 public static void HideGroupCalcInfo(GridView grid, GridColumn column)
 {
     if (column.SummaryItem != null)
     {
         column.UnGroup();
         grid.GroupSummary.Remove(column.SummaryItem);
     }
 }
Exemple #13
0
 public static RepositoryItemCalcEdit CotCalcEdit(GridColumn Column, string ColumnField, int SoThapPhan)
 {
     HelpGridColumn.SetHorzAlignment(Column, HorzAlignment.Far);
     HelpGridColumn.SetSummaryNumFormat(Column, SoThapPhan);
     Column.ColumnEdit = HelpRepository.GetCalcEdit(SoThapPhan);
     if (ColumnField != null) Column.FieldName = ColumnField;
     return (RepositoryItemCalcEdit)Column.ColumnEdit;
 }
 /// <summary>
 /// Initialises a new instance of the <see cref="SetGridColumnValueMessage"/> class.
 /// </summary>
 /// <param name="driverId">The Id of the driver the message is related to.</param>
 /// <param name="column">The column whose value is to be set.</param>
 /// <param name="colour">The column colour value.</param>
 /// <param name="value">The column value.</param>
 public SetGridColumnValueMessage(int driverId, GridColumn column,
     GridColumnColour colour, string value)
     : base(driverId)
 {
     Column = column;
     Colour = colour;
     Value = value;
 }
 ///<summary>Copies properties from another column to this instance.</summary>
 protected override void Assign(GridColumn column)
 {
     base.Assign(column);
     var col = column as SmartGridColumn;
     if (col != null) {
         ShowEditorOnMouseDown = col.ShowEditorOnMouseDown;
         AllowKeyboardActivation = col.AllowKeyboardActivation;
     }
 }
 private GridColumn<Person> GetColumnWithOptions()
 {
     GridColumn<Person> column = new GridColumn<Person>(p => p.Name, "Name", typeof(string));
     (column as IGridColumn<Person>).Sortable(true);
     column.SortOptions.SortOrder = System.Data.SqlClient.SortOrder.Descending;
     column.SortOptions.SortByQueryParameterName = "SortBy";
     column.SortOptions.SortOrderQueryParameterName = "SortOrder";
     return column;
 }
        public static RepositoryItemLookUpEdit InitCot(GridColumn column, string fieldName, bool ReadOnly)
        {
            RepositoryItemLookUpEdit re= HelpGridColumn.CotCombobox(column, TABLE_MAP, "ID", "NAME", fieldName);
            if (ReadOnly) re.NullText = "";
            var gridView = column.View;
            gridView.ShownEditor += delegate(object sender, EventArgs e)
                                    {
                                        var view = sender as GridView;
                                        if (view == null) return;
                                        if (view.FocusedColumn.FieldName == fieldName && view.ActiveEditor is LookUpEdit)
                                        {
                                            var edit = (LookUpEdit) view.ActiveEditor;
                                            var editType = edit.GetType();
                                           edit.QueryPopUp +=
                                            delegate(object senderr, System.ComponentModel.CancelEventArgs ee)
                                                {
                                                    var lookup = senderr as LookUpEdit;
                                                    if(lookup==null) return;
                                                    var dataSource = lookup.Properties.DataSource as DataTable;
                                                    if (dataSource == null) return;
                                                    var gridSource = view.DataSource as DataView;
                                                    var rowViews = gridSource.Cast<DataRowView>();
                                                    var editingValue = view.GetFocusedRowCellValue(fieldName);
                                                    var editingId = editingValue!=null? editingValue.ToString():string.Empty;
                                                    var selectedValues = string.Join(",",
                                                        rowViews.Select(v => v[fieldName].ToString()).Where(id => id != editingId).ToArray());
                                                    dataSource.DefaultView.RowFilter = string.IsNullOrEmpty(selectedValues)
                                                        ? string.Empty
                                                        : "ID NOT IN (" + selectedValues + ")";
                                                };
                                            edit.QueryCloseUp +=
                                                delegate(object senderr, System.ComponentModel.CancelEventArgs ee)
                                                {
                                                    var lookup = senderr as LookUpEdit;
                                                    if (lookup == null) return;
                                                    var dataSource = lookup.Properties.DataSource as DataTable;
                                                    if (dataSource == null) return;
                                                    dataSource.DefaultView.RowFilter = string.Empty;
                                                };

                                        }
                                    };
            gridView.HiddenEditor += delegate(object sender, EventArgs e)
                                     {
                                         var view = sender as GridView;
                                         if (view == null) return;
                                         if (view.FocusedColumn.FieldName == fieldName)
                                         {
                                             var dataSource = re.DataSource as DataTable;
                                             if (dataSource == null) return;

                                             dataSource.DefaultView.RowFilter = string.Empty;
                                         }
                                     };

            return re;
        }
Exemple #18
0
        public static CotFile Init(GridView Grid, GridColumn Column,
            String DataTb, String ColumnField, Int64 maxFilesize)
        {
            CotFile cot = new CotFile();
            cot._Init(Grid, Column, DataTb, ColumnField, maxFilesize);
            cot.Up_DownEventArgs += new CotFile.Up_DownEventHandler(cot.GetCurrentDO);

            return cot;
        }
		public GridDragDropHelper(GridView view, bool underlineHoverRow, int rowVerticalOffset = 0, GridColumn[] handledColumns = null)
			: base(view)
		{
			_view = view;
			_rowVerticalOffset = rowVerticalOffset;
			_underlineHoverRow = underlineHoverRow;
			if (handledColumns != null)
				_handledColumns.AddRange(handledColumns);
			SubscribeEvents(view);
		}
 public void SettingGridViewCheckBox(GridView view, GridColumn column)
 {
     this._view = view;
     this._column = column;
     _column.OptionsColumn.ShowCaption = false;
     view.Click += GirdViewClick;
     view.CustomDrawColumnHeader += GirdViewCustomDrawColumnHeader;
     view.DataSourceChanged += GridViewDataSourceChanged;
     view.RowClick += GridViewRowClick;
 }
 private void AppGroupSummary(GridColumn column,long[]typeIDs)
 {
     this._gridView.GroupSummary.Clear();
     foreach (Int64 item in typeIDs)
     {
         this._gridView.GroupSummary.AddRange(
         new DevExpress.XtraGrid.GridGroupSummaryItem[] {
         new DevExpress.XtraGrid.GridGroupSummaryItem((SummaryItemType)item, column.FieldName,null, "")});
     }
 }
        public static void ValidateDuplicate(this GridView view, GridColumn NameColumn, List<string> duplicates, ValidateRowEventArgs e)
        {
            if (duplicates.Count > 0)
            {
                view.SetColumnError(NameColumn,
                    Program.LanguageManager.GetString(StringResources.Settings_UniqueValueRequired));
                e.Valid = false;
            }

        }
 public void TestGridHeaderRenderer()
 {
     var renderer = new GridHeaderRenderer();
     var column = new GridColumn<TestModel, string>(c => c.Title, null);
     var htmlstring = renderer.Render(column);
     Assert.IsNotNull(htmlstring);
     var html = htmlstring.ToHtmlString();
     Assert.IsTrue(!string.IsNullOrWhiteSpace(html));
     Assert.IsTrue(html.Contains("<th"));
     Assert.IsTrue(html.Contains("class=\"grid-header\""));
 }
        public static void ValidateNotEmpty(this GridView view, GridColumn NameColumn, ValidateRowEventArgs e)
        {
            string Name = (string)view.GetRowCellValue(e.RowHandle, NameColumn);

            if (String.IsNullOrWhiteSpace(Name))
            {
                view.SetColumnError(NameColumn,
                   Program.LanguageManager.GetString(StringResources.Settings_ValueRequired));
                e.Valid = false;
            }

        }
Exemple #25
0
 public static RepositoryItemCalcEdit CotCalcEditDec(GridColumn Column, string ColumnField, int SoThapPhan, bool AllowNULL, bool AllowSpin)
 {
     RepositoryItemCalcEdit r= CotCalcEditDec(Column, ColumnField, SoThapPhan, decimal.MinValue, decimal.MaxValue, AllowNULL);
     if (AllowSpin == false)
     {
         r.Spin += delegate(object sender, SpinEventArgs e)
         {
             e.Handled = true;
         };
     }
     return r;
 }
        ///<summary>Creates a CheckableGridController that manages the checkboxes in a grid column.</summary>
        public CheckableGridController(GridColumn checkColumn)
        {
            if (checkColumn == null) throw new ArgumentNullException("checkColumn");

            CheckColumn = checkColumn;
            CheckColumn.OptionsColumn.AllowEdit = false;
            CheckColumn.ShowButtonMode = ShowButtonModeEnum.ShowAlways;

            View.BeforeLeaveRow += View_BeforeLeaveRow;
            View.KeyPress += View_KeyPress;
            View.MouseUp += View_MouseUp;
        }
Exemple #27
0
        public override object GetRowCellValue(int rowHandle, GridColumn column)
        {
            try
            {
                return base.GetRowCellValue(rowHandle, column);
            }
            catch (Exception e)
            {

                return "!error!";
            }
        }
        public static RepositoryItemLookUpEdit InitCot(GridColumn column, string fieldName, bool? isAdd)
        {
            string sql = string.Format(@"SELECT *
                           From {0}
                           where 1=1", TABLE_MAP);

            var query = new QueryBuilder(sql);
            if (isAdd == true)
                query.addCondition("VISIBLE_BIT='Y'");
            query.setAscOrderBy("lower(NAME)");
            DataSet ds = HelpDB.getDatabase().LoadDataSet(query, TABLE_MAP);
            return HelpGridColumn.CotCombobox(column, ds, "ID", "NAME", fieldName);
        }
Exemple #29
0
 public static void CreateComboItemDM(GridColumn column, string tenDM, string value, string display, string field)
 {
     try
     {
         if (tenDM != "")
         {
             DataSet ds = DABase.getDatabase().LoadTable(tenDM);
             HelpGridColumn.CotCombobox(column, ds, value, display, field);
         }
         else
             column.ColumnEdit = null;
     }
     catch { }
 }
Exemple #30
0
 //public static void ShowAdvBandsGridViewIndicator(AdvBandedGridView advGrid)
 //{
 //    advGrid.CustomDrawRowIndicator += delegate(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e)
 //    {
 //        if (e.Info.IsRowIndicator)
 //        {
 //            int stt = e.RowHandle + 1;
 //            e.Info.DisplayText = stt.ToString();
 //        }
 //    };
 //}
 public static RepositoryItemRichTextEdit CotRichTextEit(GridColumn Column, string ColumnField)
 {
     HelpGridColumn.SetHorzAlignment(Column, DevExpress.Utils.HorzAlignment.Center);
     RepositoryItemRichTextEdit rich = new RepositoryItemRichTextEdit();
     rich.ReadOnly = true;
     rich.DocumentFormat = DevExpress.XtraRichEdit.DocumentFormat.Rtf;
     rich.EncodingWebName = "utf-8";
     Column.ColumnEdit = rich;
     if (ColumnField != null)
     {
         Column.FieldName = ColumnField;
     }
     return (RepositoryItemRichTextEdit)Column.ColumnEdit;
 }
Exemple #31
0
        public void GridColumn_SetsIsEncoded()
        {
            column = new GridColumn <GridModel, Object>(grid, model => model.Name);

            Assert.True(column.IsEncoded);
        }
Exemple #32
0
        public void GridColumn_NoDisplayAttribute_SetsNullTitle()
        {
            column = new GridColumn <GridModel, Object>(grid, model => model.Name);

            Assert.Null(column.Title.ToString());
        }
Exemple #33
0
        /// <summary>
        /// 트리를 클릭했을때
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Windows.Forms.TreeNodeMouseClickEventArgs"/> instance containing the event data.</param>
        private void treeView_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            try
            {
                if (e.Node.Index < 0 || treeView.Nodes.Count <= 0 || dtProject.Rows.Count <= 0)
                {
                    return;
                }

                TextBoxMenuid.Text      = "";
                TextBoxMenuName.Text    = "";
                TextBoxMenuDisplay.Text = "0";

                TextBoxProgramid.Text        = "";
                TextBoxProgramName.Text      = "";
                TextBoxProgramDisplay.Text   = "0";
                TextBoxProgramNamesapce.Text = "";

                string nodevalue = e.Node.Name;

                if (e.Node.Level < 1)
                {
                    DataRow[] r = dtProject.Select("LEVEL_CODE2 = '" + nodevalue + "'", "");
                    if (r.Length <= 0)
                    {
                        return;
                    }
                    TextBoxMenuid.Text      = r[0]["LEVEL_CODE2"].ToString().Trim();
                    TextBoxMenuName.Text    = r[0]["LEVEL_NAME2"].ToString().Trim();
                    TextBoxMenuDisplay.Text = r[0]["LEVEL_SORT2"].ToString().Trim();


                    DevExpress.XtraGrid.Columns.GridColumn[] cols;
                    object[] obj;
                    cols = new GridColumn[] { this.gridView.Columns["LEVEL_CODE2"] };
                    obj  = new object[] { nodevalue };


                    Cls.Grid.Options.SelectGridRow(this.gridView, cols, obj);
                }
                else
                {
                    //nodevalue = e.Node.Parent.Nodes.Name;
                    DataRow[] r = dtProject.Select("LEVEL_CODE2 = '" + e.Node.Parent.Name + "' AND LEVEL_CODE3 = '" + nodevalue + "'", "");
                    if (r.Length <= 0)
                    {
                        return;
                    }
                    TextBoxMenuid.Text      = r[0]["LEVEL_CODE2"].ToString().Trim();
                    TextBoxMenuName.Text    = r[0]["LEVEL_NAME2"].ToString().Trim();
                    TextBoxMenuDisplay.Text = r[0]["LEVEL_SORT2"].ToString().Trim();

                    TextBoxProgramid.Text        = r[0]["LEVEL_CODE3"].ToString().Trim();
                    TextBoxProgramName.Text      = r[0]["LEVEL_NAME3"].ToString().Trim();
                    TextBoxProgramDisplay.Text   = r[0]["LEVEL_SORT3"].ToString().Trim();
                    TextBoxProgramNamesapce.Text = r[0]["PROGRAM_NAMESPACE"].ToString().Trim();


                    DevExpress.XtraGrid.Columns.GridColumn[] cols;
                    object[] obj;
                    cols = new GridColumn[] { this.gridView.Columns["PROGRAM_NAMESPACE"] };
                    obj  = new object[] { TextBoxProgramNamesapce.Text.Trim() };

                    Cls.Grid.Options.SelectGridRow(this.gridView, cols, obj);
                }
            }
            catch (Exception ex)
            {
                Basic.ShowMessage(3, ex.Message);
            }
        }
Exemple #34
0
        private void button2_Click(object sender, EventArgs e)
        {
            string pathWord = "C:\\Users\\mishka\\Desktop\\UpWork\\wordTOXml\\wordTOXml\\bin\\Debug\\newword\\Before.docx";
            string savePath = "C:\\Users\\mishka\\Desktop\\UpWork\\wordTOXml\\wordTOXml\\bin\\Debug\\newword\\After.docx";

            using (var mainDoc = WordprocessingDocument.Open(pathWord, false))
                using (var resultDoc = WordprocessingDocument.Create(savePath,
                                                                     WordprocessingDocumentType.Document))
                {
                    // copy parts from source document to new document
                    foreach (var part in mainDoc.Parts)
                    {
                        resultDoc.AddPart(part.OpenXmlPart, part.RelationshipId);
                    }

                    IEnumerable <DocumentFormat.OpenXml.Vml.Shape> shapes =
                        resultDoc.MainDocumentPart.Document.Body.Descendants <DocumentFormat.OpenXml.Vml.Shape>();

                    UInt32 height = 0;

                    foreach (var shape in shapes)
                    {
                        // Getting shape height for adjusting table height
                        var    val        = shape.Style.Value;
                        string height_str = val.Split(new string[] { "height:" }, StringSplitOptions.None)[1]
                                            .Split(new string[] { "pt;" }, StringSplitOptions.None)[0]
                                            .Trim();
                        double h1 = double.Parse(height_str, System.Globalization.CultureInfo.InvariantCulture);
                        int    h  = Convert.ToInt32(h1);
                        height = Convert.ToUInt32(h);

                        //shape
                        shape.HorizontalAlignment = DocumentFormat.OpenXml.Vml.Office.HorizontalRuleAlignmentValues.Center;
                    }

                    foreach (var cc in resultDoc.ContentControls())
                    {
                        DocumentFormat.OpenXml.Wordprocessing.Table table1 = new DocumentFormat.OpenXml.Wordprocessing.Table();

                        TableProperties tableProperties1 = new TableProperties();
                        DocumentFormat.OpenXml.Wordprocessing.TableStyle tableStyle1 = new DocumentFormat.OpenXml.Wordprocessing.TableStyle()
                        {
                            Val = "ad"
                        };
                        BiDiVisual biDiVisual1 = new BiDiVisual();
                        TableWidth tableWidth1 = new TableWidth()
                        {
                            Width = "5200", Type = TableWidthUnitValues.Pct
                        };
                        TableJustification tableJustification1 = new TableJustification()
                        {
                            Val = TableRowAlignmentValues.Center
                        };

                        TableCellMarginDefault tableCellMarginDefault1 = new TableCellMarginDefault();
                        TableCellLeftMargin    tableCellLeftMargin1    = new TableCellLeftMargin()
                        {
                            Width = 0, Type = TableWidthValues.Dxa
                        };
                        TableCellRightMargin tableCellRightMargin1 = new TableCellRightMargin()
                        {
                            Width = 0, Type = TableWidthValues.Dxa
                        };


                        tableCellMarginDefault1.Append(tableCellLeftMargin1);
                        tableCellMarginDefault1.Append(tableCellRightMargin1);
                        TableLook tableLook1 = new TableLook()
                        {
                            Val = "04A0"
                        };


                        tableProperties1.Append(tableStyle1);
                        tableProperties1.Append(biDiVisual1);
                        tableProperties1.Append(tableWidth1);
                        tableProperties1.Append(tableJustification1);
                        tableProperties1.Append(tableCellMarginDefault1);
                        tableProperties1.Append(tableLook1);


                        TableGrid  tableGrid1  = new TableGrid();
                        GridColumn gridColumn1 = new GridColumn()
                        {
                            Width = "555"
                        };
                        GridColumn gridColumn2 = new GridColumn()
                        {
                            Width = "556"
                        };


                        tableGrid1.Append(gridColumn1);
                        tableGrid1.Append(gridColumn2);

                        TableRow tableRow1 = new TableRow()
                        {
                            RsidTableRowAddition = "00AE49FD", RsidTableRowProperties = "00AE49FD"
                        };

                        TableRowProperties tableRowProperties1 = new TableRowProperties();
                        TableRowHeight     tableRowHeight1     = new TableRowHeight()
                        {
                            Val = 200, HeightType = HeightRuleValues.Exact
                        };

                        TableJustification tableJustification2 = new TableJustification()
                        {
                            Val = TableRowAlignmentValues.Center
                        };

                        tableRowProperties1.Append(tableRowHeight1);
                        tableRowProperties1.Append(tableJustification2);

                        TableCell tableCell1 = new TableCell();

                        TableCellProperties tableCellProperties1 = new TableCellProperties();
                        TableCellWidth      tableCellWidth1      = new TableCellWidth()
                        {
                            Width = "100", Type = TableWidthUnitValues.Pct
                        };
                        //tableCell1.TableCellProperties.TableCellMargin.BottomMargin = new BottomMargin() { Width = "0" };
                        //tableCell1.TableCellProperties.TableCellMargin.TopMargin = new TopMargin() { Width = "0" };
                        TableCellVerticalAlignment tableCellVerticalAlignment = new TableCellVerticalAlignment()
                        {
                            Val = TableVerticalAlignmentValues.Top
                        };
                        tableCellProperties1.Append(tableCellWidth1, tableCellVerticalAlignment);

                        DocumentFormat.OpenXml.Wordprocessing.Paragraph paragraph2 = new DocumentFormat.OpenXml.Wordprocessing.Paragraph()
                        {
                            RsidParagraphAddition = "00AE49FD", RsidParagraphProperties = "00AE49FD", RsidRunAdditionDefault = "00AE49FD"
                        };

                        ParagraphProperties paragraphProperties2 = new ParagraphProperties();
                        Justification       justification1       = new Justification()
                        {
                            Val = JustificationValues.Right
                        };

                        ParagraphMarkRunProperties paragraphMarkRunProperties2 = new ParagraphMarkRunProperties();
                        RightToLeftText            rightToLeftText2            = new RightToLeftText();

                        paragraphMarkRunProperties2.Append(rightToLeftText2);

                        paragraphProperties2.Append(justification1);
                        paragraphProperties2.Append(paragraphMarkRunProperties2);

                        paragraph2.Append(paragraphProperties2);

                        tableCell1.Append(tableCellProperties1);
                        tableCell1.Append(paragraph2);

                        TableCell tableCell2 = new TableCell();

                        TableCellProperties tableCellProperties2 = new TableCellProperties();
                        TableCellWidth      tableCellWidth2      = new TableCellWidth()
                        {
                            Width = "100", Type = TableWidthUnitValues.Pct
                        };
                        //tableCell2.TableCellProperties.TableCellMargin.BottomMargin = new BottomMargin() { Width = "0" };
                        //tableCell2.TableCellProperties.TableCellMargin.TopMargin = new TopMargin() { Width = "0" };
                        TableCellVerticalAlignment tableCellVerticalAlignment1 = new TableCellVerticalAlignment()
                        {
                            Val = TableVerticalAlignmentValues.Bottom
                        };

                        tableCellProperties2.Append(tableCellWidth2);
                        tableCellProperties2.Append(tableCellVerticalAlignment1);

                        DocumentFormat.OpenXml.Wordprocessing.Paragraph paragraph3 = new DocumentFormat.OpenXml.Wordprocessing.Paragraph()
                        {
                            RsidParagraphAddition = "00AE49FD", RsidParagraphProperties = "00AE49FD", RsidRunAdditionDefault = "00AE49FD"
                        };

                        ParagraphProperties paragraphProperties3 = new ParagraphProperties();
                        Justification       justification2       = new Justification()
                        {
                            Val = JustificationValues.Left
                        };

                        ParagraphMarkRunProperties paragraphMarkRunProperties3 = new ParagraphMarkRunProperties();
                        RightToLeftText            rightToLeftText3            = new RightToLeftText();

                        paragraphMarkRunProperties3.Append(rightToLeftText3);

                        paragraphProperties3.Append(justification2);
                        paragraphProperties3.Append(paragraphMarkRunProperties3);

                        paragraph3.Append(paragraphProperties3);

                        tableCell2.Append(tableCellProperties2);
                        tableCell2.Append(paragraph3);

                        tableRow1.Append(tableRowProperties1);
                        tableRow1.Append(tableCell1);
                        tableRow1.Append(tableCell2);

                        table1.Append(tableProperties1);
                        table1.Append(tableGrid1);
                        table1.Append(tableRow1);

                        cc.AppendChild(table1);
                    }
                }
        }
Exemple #35
0
 private void onCopyMetaDataColumnControl(MetaDataTable metaData, GridColumn column)
 {
     OnEvent(() => _presenter.RaiseCopyMetaDataColumnControlEvent(metaData, column.FieldName));
 }
Exemple #36
0
 public void SetUp()
 {
     theColumn = GridColumn <Case> .ColumnFor(x => x.Condition);
 }
Exemple #37
0
        /// <summary>
        /// Gets the covered cells range for the given row and column index.
        /// </summary>
        /// <param name="column">The GridColumn.</param>
        /// <param name="rowIndex">Row index of the cell.</param>
        /// <param name="columnIndex">Column index of the cell.</param>
        /// <param name="rowData">The row data of the record.</param>
        /// <returns>Returns the range of the covered cells.</returns>
        private CoveredCellInfo GetRange(GridColumn column, int rowIndex, int columnIndex, object rowData)
        {
            var    range = new CoveredCellInfo(columnIndex, columnIndex, rowIndex, rowIndex);
            object data  = propertyAccessProvider.GetFormattedValue(rowData, column.MappingName);

            GridColumn leftColumn  = null;
            GridColumn rightColumn = null;

            // total rows count.
            int recordsCount = this.sfDataGrid1.GroupColumnDescriptions.Count != 0 ? (this.sfDataGrid1.View.TopLevelGroup.DisplayElements.Count + this.sfDataGrid1.TableSummaryRows.Count + this.sfDataGrid1.UnboundRows.Count + (this.sfDataGrid1.AddNewRowPosition == RowPosition.Top ? +1 : 0)) : (this.sfDataGrid1.View.Records.Count + this.sfDataGrid1.TableSummaryRows.Count + this.sfDataGrid1.UnboundRows.Count + (this.sfDataGrid1.AddNewRowPosition == RowPosition.Top ? +1 : 0));

            recordsCount += this.sfDataGrid1.TableControl.GetHeaderIndex();

            // Merge Horizontally
            // compare right column
            for (int i = sfDataGrid1.Columns.IndexOf(column); i < this.sfDataGrid1.Columns.Count - 1; i++)
            {
                var compareData = propertyAccessProvider.GetFormattedValue(rowData, sfDataGrid1.Columns[i + 1].MappingName);

                if (compareData == null)
                {
                    break;
                }

                if (!compareData.Equals(data))
                {
                    break;
                }
                rightColumn = sfDataGrid1.Columns[i + 1];
            }

            // compare left column.
            for (int i = sfDataGrid1.Columns.IndexOf(column); i > 0; i--)
            {
                var compareData = propertyAccessProvider.GetFormattedValue(rowData, sfDataGrid1.Columns[i - 1].MappingName);

                if (compareData == null)
                {
                    break;
                }

                if (!compareData.Equals(data))
                {
                    break;
                }
                leftColumn = sfDataGrid1.Columns[i - 1];
            }

            if (leftColumn != null || rightColumn != null)
            {
                // set left index
                if (leftColumn != null)
                {
                    var leftColumnIndex = this.sfDataGrid1.TableControl.ResolveToScrollColumnIndex(this.sfDataGrid1.Columns.IndexOf(leftColumn));
                    range = new CoveredCellInfo(leftColumnIndex, range.Right, range.Top, range.Bottom);
                }

                // set right index
                if (rightColumn != null)
                {
                    var rightColumIndex = this.sfDataGrid1.TableControl.ResolveToScrollColumnIndex(this.sfDataGrid1.Columns.IndexOf(rightColumn));
                    range = new CoveredCellInfo(range.Left, rightColumIndex, range.Top, range.Bottom);
                }
                return(range);
            }

            // Merge Vertically from the row index.
            int previousRowIndex = -1;
            int nextRowIndex     = -1;

            // Get previous row data.
            var startIndex = sfDataGrid1.TableControl.ResolveStartIndexBasedOnPosition();

            for (int i = rowIndex - 1; i >= startIndex; i--)
            {
                var previousData = this.sfDataGrid1.GetRecordEntryAtRowIndex(i);
                if (previousData == null || !previousData.IsRecords)
                {
                    break;
                }

                var compareData = propertyAccessProvider.GetFormattedValue((previousData as RecordEntry).Data, column.MappingName);

                if (compareData == null)
                {
                    break;
                }

                if (!compareData.Equals(data))
                {
                    break;
                }
                previousRowIndex = i;
            }

            // get next row data.
            for (int i = rowIndex + 1; i < recordsCount + 1; i++)
            {
                var nextData = this.sfDataGrid1.GetRecordEntryAtRowIndex(i);
                if (nextData == null || !nextData.IsRecords)
                {
                    break;
                }

                var compareData = propertyAccessProvider.GetFormattedValue((nextData as RecordEntry).Data, column.MappingName);

                if (compareData == null)
                {
                    break;
                }

                if (!compareData.Equals(data))
                {
                    break;
                }
                nextRowIndex = i;
            }

            if (previousRowIndex != -1 || nextRowIndex != -1)
            {
                if (previousRowIndex != -1)
                {
                    range = new CoveredCellInfo(range.Left, range.Right, previousRowIndex, range.Bottom);
                }

                if (nextRowIndex != -1)
                {
                    range = new CoveredCellInfo(range.Left, range.Right, range.Top, nextRowIndex);
                }
                return(range);
            }

            return(null);
        }
 private void InitializeComponent()
 {
     this.components                = new System.ComponentModel.Container();
     this.barManager1               = new DevExpress.XtraBars.BarManager(this.components);
     this.bar2                      = new DevExpress.XtraBars.Bar();
     this.barLargeButtonItem1       = new DevExpress.XtraBars.BarLargeButtonItem();
     this.barLargeButtonItem2       = new DevExpress.XtraBars.BarLargeButtonItem();
     this.barLargeButtonItem3       = new DevExpress.XtraBars.BarLargeButtonItem();
     this.bar3                      = new DevExpress.XtraBars.Bar();
     this.barDockControlTop         = new DevExpress.XtraBars.BarDockControl();
     this.barDockControlBottom      = new DevExpress.XtraBars.BarDockControl();
     this.barDockControlLeft        = new DevExpress.XtraBars.BarDockControl();
     this.barDockControlRight       = new DevExpress.XtraBars.BarDockControl();
     this.gridControl1              = new DevExpress.XtraGrid.GridControl();
     this.gridView1                 = new DevExpress.XtraGrid.Views.Grid.GridView();
     this.gridColumn1               = new DevExpress.XtraGrid.Columns.GridColumn();
     this.gridColumn2               = new DevExpress.XtraGrid.Columns.GridColumn();
     this.gridColumn3               = new DevExpress.XtraGrid.Columns.GridColumn();
     this.gridColumn4               = new DevExpress.XtraGrid.Columns.GridColumn();
     this.gridColumn14              = new DevExpress.XtraGrid.Columns.GridColumn();
     this.gridColumn15              = new DevExpress.XtraGrid.Columns.GridColumn();
     this.gridColumn16              = new DevExpress.XtraGrid.Columns.GridColumn();
     this.gridColumn17              = new DevExpress.XtraGrid.Columns.GridColumn();
     this.gridColumn19              = new DevExpress.XtraGrid.Columns.GridColumn();
     this.repositoryItemButtonEdit1 = new DevExpress.XtraEditors.Repository.RepositoryItemButtonEdit();
     this.panelControl1             = new DevExpress.XtraEditors.PanelControl();
     this.panelControl4             = new DevExpress.XtraEditors.PanelControl();
     this.panelControl3             = new DevExpress.XtraEditors.PanelControl();
     this.simpleButton2             = new DevExpress.XtraEditors.SimpleButton();
     this.simpleButton1             = new DevExpress.XtraEditors.SimpleButton();
     this.textEdit1                 = new DevExpress.XtraEditors.TextEdit();
     this.labelControl2             = new DevExpress.XtraEditors.LabelControl();
     this.comboBoxEdit1             = new DevExpress.XtraEditors.ComboBoxEdit();
     this.labelControl1             = new DevExpress.XtraEditors.LabelControl();
     this.panelControl2             = new DevExpress.XtraEditors.PanelControl();
     this.gridControl2              = new DevExpress.XtraGrid.GridControl();
     this.gridView2                 = new DevExpress.XtraGrid.Views.Grid.GridView();
     this.gridColumn9               = new DevExpress.XtraGrid.Columns.GridColumn();
     this.gridColumn10              = new DevExpress.XtraGrid.Columns.GridColumn();
     this.gridColumn11              = new DevExpress.XtraGrid.Columns.GridColumn();
     this.gridColumn12              = new DevExpress.XtraGrid.Columns.GridColumn();
     this.gridColumn5               = new DevExpress.XtraGrid.Columns.GridColumn();
     this.gridColumn6               = new DevExpress.XtraGrid.Columns.GridColumn();
     this.gridColumn7               = new DevExpress.XtraGrid.Columns.GridColumn();
     this.gridColumn8               = new DevExpress.XtraGrid.Columns.GridColumn();
     this.timer1                    = new System.Windows.Forms.Timer(this.components);
     ((System.ComponentModel.ISupportInitialize)(this.barManager1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.gridControl1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.gridView1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.repositoryItemButtonEdit1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.panelControl1)).BeginInit();
     this.panelControl1.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.panelControl4)).BeginInit();
     this.panelControl4.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.panelControl3)).BeginInit();
     this.panelControl3.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.textEdit1.Properties)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.comboBoxEdit1.Properties)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.panelControl2)).BeginInit();
     this.panelControl2.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.gridControl2)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.gridView2)).BeginInit();
     this.SuspendLayout();
     //
     // barManager1
     //
     this.barManager1.AllowMoveBarOnToolbar   = false;
     this.barManager1.AllowQuickCustomization = false;
     this.barManager1.Bars.AddRange(new DevExpress.XtraBars.Bar[] {
         this.bar2,
         this.bar3
     });
     this.barManager1.DockControls.Add(this.barDockControlTop);
     this.barManager1.DockControls.Add(this.barDockControlBottom);
     this.barManager1.DockControls.Add(this.barDockControlLeft);
     this.barManager1.DockControls.Add(this.barDockControlRight);
     this.barManager1.Form = this;
     this.barManager1.Items.AddRange(new DevExpress.XtraBars.BarItem[] {
         this.barLargeButtonItem1,
         this.barLargeButtonItem2,
         this.barLargeButtonItem3
     });
     this.barManager1.MainMenu  = this.bar2;
     this.barManager1.MaxItemId = 11;
     this.barManager1.StatusBar = this.bar3;
     //
     // bar2
     //
     this.bar2.BarName       = "Main menu";
     this.bar2.DockCol       = 0;
     this.bar2.DockRow       = 0;
     this.bar2.DockStyle     = DevExpress.XtraBars.BarDockStyle.Top;
     this.bar2.FloatLocation = new System.Drawing.Point(422, 153);
     this.bar2.LinksPersistInfo.AddRange(new DevExpress.XtraBars.LinkPersistInfo[] {
         new DevExpress.XtraBars.LinkPersistInfo(this.barLargeButtonItem1),
         new DevExpress.XtraBars.LinkPersistInfo(this.barLargeButtonItem2),
         new DevExpress.XtraBars.LinkPersistInfo(this.barLargeButtonItem3)
     });
     this.bar2.OptionsBar.DrawDragBorder = false;
     this.bar2.OptionsBar.MultiLine      = true;
     this.bar2.OptionsBar.UseWholeRow    = true;
     this.bar2.Text = "Main menu";
     //
     // barLargeButtonItem1
     //
     this.barLargeButtonItem1.Caption    = "预览";
     this.barLargeButtonItem1.Id         = 8;
     this.barLargeButtonItem1.Name       = "barLargeButtonItem1";
     this.barLargeButtonItem1.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.barLargeButtonItem1_ItemClick);
     //
     // barLargeButtonItem2
     //
     this.barLargeButtonItem2.Caption    = "导出";
     this.barLargeButtonItem2.Id         = 9;
     this.barLargeButtonItem2.Name       = "barLargeButtonItem2";
     this.barLargeButtonItem2.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.barLargeButtonItem2_ItemClick);
     //
     // barLargeButtonItem3
     //
     this.barLargeButtonItem3.Caption    = "考核详情";
     this.barLargeButtonItem3.Id         = 10;
     this.barLargeButtonItem3.Name       = "barLargeButtonItem3";
     this.barLargeButtonItem3.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.barLargeButtonItem3_ItemClick);
     //
     // bar3
     //
     this.bar3.BarName      = "Status bar";
     this.bar3.CanDockStyle = DevExpress.XtraBars.BarCanDockStyle.Bottom;
     this.bar3.DockCol      = 0;
     this.bar3.DockRow      = 0;
     this.bar3.DockStyle    = DevExpress.XtraBars.BarDockStyle.Bottom;
     this.bar3.OptionsBar.AllowQuickCustomization = false;
     this.bar3.OptionsBar.DrawDragBorder          = false;
     this.bar3.OptionsBar.UseWholeRow             = true;
     this.bar3.Text = "Status bar";
     //
     // barDockControlTop
     //
     this.barDockControlTop.CausesValidation = false;
     this.barDockControlTop.Dock             = System.Windows.Forms.DockStyle.Top;
     this.barDockControlTop.Location         = new System.Drawing.Point(0, 0);
     this.barDockControlTop.Manager          = this.barManager1;
     this.barDockControlTop.Size             = new System.Drawing.Size(801, 24);
     //
     // barDockControlBottom
     //
     this.barDockControlBottom.CausesValidation = false;
     this.barDockControlBottom.Dock             = System.Windows.Forms.DockStyle.Bottom;
     this.barDockControlBottom.Location         = new System.Drawing.Point(0, 442);
     this.barDockControlBottom.Manager          = this.barManager1;
     this.barDockControlBottom.Size             = new System.Drawing.Size(801, 23);
     //
     // barDockControlLeft
     //
     this.barDockControlLeft.CausesValidation = false;
     this.barDockControlLeft.Dock             = System.Windows.Forms.DockStyle.Left;
     this.barDockControlLeft.Location         = new System.Drawing.Point(0, 24);
     this.barDockControlLeft.Manager          = this.barManager1;
     this.barDockControlLeft.Size             = new System.Drawing.Size(0, 418);
     //
     // barDockControlRight
     //
     this.barDockControlRight.CausesValidation = false;
     this.barDockControlRight.Dock             = System.Windows.Forms.DockStyle.Right;
     this.barDockControlRight.Location         = new System.Drawing.Point(801, 24);
     this.barDockControlRight.Manager          = this.barManager1;
     this.barDockControlRight.Size             = new System.Drawing.Size(0, 418);
     //
     // gridControl1
     //
     this.gridControl1.Dock        = System.Windows.Forms.DockStyle.Fill;
     this.gridControl1.Location    = new System.Drawing.Point(2, 2);
     this.gridControl1.MainView    = this.gridView1;
     this.gridControl1.MenuManager = this.barManager1;
     this.gridControl1.Name        = "gridControl1";
     this.gridControl1.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] {
         this.repositoryItemButtonEdit1
     });
     this.gridControl1.Size     = new System.Drawing.Size(793, 373);
     this.gridControl1.TabIndex = 4;
     this.gridControl1.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
         this.gridView1
     });
     //
     // gridView1
     //
     this.gridView1.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
         this.gridColumn1,
         this.gridColumn2,
         this.gridColumn3,
         this.gridColumn4,
         this.gridColumn14,
         this.gridColumn15,
         this.gridColumn16,
         this.gridColumn17,
         this.gridColumn19
     });
     this.gridView1.FocusRectStyle           = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFullFocus;
     this.gridView1.GridControl              = this.gridControl1;
     this.gridView1.Name                     = "gridView1";
     this.gridView1.OptionsBehavior.Editable = false;
     this.gridView1.OptionsCustomization.AllowColumnMoving     = false;
     this.gridView1.OptionsCustomization.AllowFilter           = false;
     this.gridView1.OptionsCustomization.AllowQuickHideColumns = false;
     this.gridView1.OptionsView.ShowGroupPanel  = false;
     this.gridView1.OptionsView.ShowViewCaption = true;
     this.gridView1.ViewCaption = "此次考核成绩";
     this.gridView1.RowClick   += new DevExpress.XtraGrid.Views.Grid.RowClickEventHandler(this.gridView1_RowClick);
     //
     // gridColumn1
     //
     this.gridColumn1.Caption      = "学号";
     this.gridColumn1.FieldName    = "StudyNO";
     this.gridColumn1.Name         = "gridColumn1";
     this.gridColumn1.Visible      = true;
     this.gridColumn1.VisibleIndex = 0;
     this.gridColumn1.Width        = 59;
     //
     // gridColumn2
     //
     this.gridColumn2.Caption      = "姓名";
     this.gridColumn2.FieldName    = "StudyName";
     this.gridColumn2.Name         = "gridColumn2";
     this.gridColumn2.Visible      = true;
     this.gridColumn2.VisibleIndex = 1;
     this.gridColumn2.Width        = 90;
     //
     // gridColumn3
     //
     this.gridColumn3.Caption      = "性别";
     this.gridColumn3.FieldName    = "IsMan";
     this.gridColumn3.Name         = "gridColumn3";
     this.gridColumn3.Visible      = true;
     this.gridColumn3.VisibleIndex = 2;
     this.gridColumn3.Width        = 43;
     //
     // gridColumn4
     //
     this.gridColumn4.Caption      = "用户名";
     this.gridColumn4.FieldName    = "UserName";
     this.gridColumn4.Name         = "gridColumn4";
     this.gridColumn4.Visible      = true;
     this.gridColumn4.VisibleIndex = 3;
     this.gridColumn4.Width        = 81;
     //
     // gridColumn14
     //
     this.gridColumn14.Caption      = "考核成绩";
     this.gridColumn14.FieldName    = "score";
     this.gridColumn14.Name         = "gridColumn14";
     this.gridColumn14.Visible      = true;
     this.gridColumn14.VisibleIndex = 4;
     this.gridColumn14.Width        = 103;
     //
     // gridColumn15
     //
     this.gridColumn15.Caption      = "答题次数";
     this.gridColumn15.FieldName    = "testtimes";
     this.gridColumn15.Name         = "gridColumn15";
     this.gridColumn15.Visible      = true;
     this.gridColumn15.VisibleIndex = 5;
     this.gridColumn15.Width        = 103;
     //
     // gridColumn16
     //
     this.gridColumn16.Caption      = "答题用时";
     this.gridColumn16.FieldName    = "usetime";
     this.gridColumn16.Name         = "gridColumn16";
     this.gridColumn16.Visible      = true;
     this.gridColumn16.VisibleIndex = 6;
     this.gridColumn16.Width        = 115;
     //
     // gridColumn17
     //
     this.gridColumn17.Caption      = "答题时间";
     this.gridColumn17.FieldName    = "begintime";
     this.gridColumn17.Name         = "gridColumn17";
     this.gridColumn17.Visible      = true;
     this.gridColumn17.VisibleIndex = 7;
     //
     // gridColumn19
     //
     this.gridColumn19.Caption      = "考核状态";
     this.gridColumn19.FieldName    = "CheckState";
     this.gridColumn19.Name         = "gridColumn19";
     this.gridColumn19.Visible      = true;
     this.gridColumn19.VisibleIndex = 8;
     //
     // repositoryItemButtonEdit1
     //
     this.repositoryItemButtonEdit1.AutoHeight = false;
     this.repositoryItemButtonEdit1.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
         new DevExpress.XtraEditors.Controls.EditorButton()
     });
     this.repositoryItemButtonEdit1.Name = "repositoryItemButtonEdit1";
     //
     // panelControl1
     //
     this.panelControl1.Controls.Add(this.panelControl4);
     this.panelControl1.Controls.Add(this.panelControl3);
     this.panelControl1.Dock     = System.Windows.Forms.DockStyle.Fill;
     this.panelControl1.Location = new System.Drawing.Point(0, 24);
     this.panelControl1.Name     = "panelControl1";
     this.panelControl1.Size     = new System.Drawing.Size(801, 418);
     this.panelControl1.TabIndex = 5;
     //
     // panelControl4
     //
     this.panelControl4.Controls.Add(this.gridControl1);
     this.panelControl4.Dock     = System.Windows.Forms.DockStyle.Fill;
     this.panelControl4.Location = new System.Drawing.Point(2, 39);
     this.panelControl4.Name     = "panelControl4";
     this.panelControl4.Size     = new System.Drawing.Size(797, 377);
     this.panelControl4.TabIndex = 6;
     //
     // panelControl3
     //
     this.panelControl3.Controls.Add(this.simpleButton2);
     this.panelControl3.Controls.Add(this.simpleButton1);
     this.panelControl3.Controls.Add(this.textEdit1);
     this.panelControl3.Controls.Add(this.labelControl2);
     this.panelControl3.Controls.Add(this.comboBoxEdit1);
     this.panelControl3.Controls.Add(this.labelControl1);
     this.panelControl3.Dock     = System.Windows.Forms.DockStyle.Top;
     this.panelControl3.Location = new System.Drawing.Point(2, 2);
     this.panelControl3.Name     = "panelControl3";
     this.panelControl3.Size     = new System.Drawing.Size(797, 37);
     this.panelControl3.TabIndex = 5;
     //
     // simpleButton2
     //
     this.simpleButton2.Location = new System.Drawing.Point(329, 3);
     this.simpleButton2.Name     = "simpleButton2";
     this.simpleButton2.Size     = new System.Drawing.Size(98, 30);
     this.simpleButton2.TabIndex = 5;
     this.simpleButton2.Text     = "全部显示";
     this.simpleButton2.Click   += new System.EventHandler(this.simpleButton2_Click);
     //
     // simpleButton1
     //
     this.simpleButton1.Location = new System.Drawing.Point(246, 3);
     this.simpleButton1.Name     = "simpleButton1";
     this.simpleButton1.Size     = new System.Drawing.Size(77, 30);
     this.simpleButton1.TabIndex = 4;
     this.simpleButton1.Text     = "查找";
     this.simpleButton1.Click   += new System.EventHandler(this.simpleButton1_Click);
     //
     // textEdit1
     //
     this.textEdit1.EditValue   = "";
     this.textEdit1.Location    = new System.Drawing.Point(139, 5);
     this.textEdit1.MenuManager = this.barManager1;
     this.textEdit1.Name        = "textEdit1";
     this.textEdit1.Size        = new System.Drawing.Size(82, 20);
     this.textEdit1.TabIndex    = 3;
     //
     // labelControl2
     //
     this.labelControl2.Location = new System.Drawing.Point(105, 8);
     this.labelControl2.Name     = "labelControl2";
     this.labelControl2.Size     = new System.Drawing.Size(28, 14);
     this.labelControl2.TabIndex = 2;
     this.labelControl2.Text     = "查找:";
     //
     // comboBoxEdit1
     //
     this.comboBoxEdit1.EditValue   = "学号";
     this.comboBoxEdit1.Location    = new System.Drawing.Point(24, 4);
     this.comboBoxEdit1.MenuManager = this.barManager1;
     this.comboBoxEdit1.Name        = "comboBoxEdit1";
     this.comboBoxEdit1.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
         new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)
     });
     this.comboBoxEdit1.Properties.Items.AddRange(new object[] {
         "学号",
         "姓名",
         "用户名"
     });
     this.comboBoxEdit1.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor;
     this.comboBoxEdit1.Size     = new System.Drawing.Size(75, 20);
     this.comboBoxEdit1.TabIndex = 1;
     //
     // labelControl1
     //
     this.labelControl1.Location = new System.Drawing.Point(6, 6);
     this.labelControl1.Name     = "labelControl1";
     this.labelControl1.Size     = new System.Drawing.Size(12, 14);
     this.labelControl1.TabIndex = 0;
     this.labelControl1.Text     = "按";
     //
     // panelControl2
     //
     this.panelControl2.Controls.Add(this.gridControl2);
     this.panelControl2.Dock     = System.Windows.Forms.DockStyle.Bottom;
     this.panelControl2.Location = new System.Drawing.Point(0, 243);
     this.panelControl2.Name     = "panelControl2";
     this.panelControl2.Size     = new System.Drawing.Size(801, 199);
     this.panelControl2.TabIndex = 6;
     //
     // gridControl2
     //
     this.gridControl2.Dock        = System.Windows.Forms.DockStyle.Fill;
     this.gridControl2.Location    = new System.Drawing.Point(2, 2);
     this.gridControl2.MainView    = this.gridView2;
     this.gridControl2.MenuManager = this.barManager1;
     this.gridControl2.Name        = "gridControl2";
     this.gridControl2.Size        = new System.Drawing.Size(797, 195);
     this.gridControl2.TabIndex    = 0;
     this.gridControl2.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
         this.gridView2
     });
     //
     // gridView2
     //
     this.gridView2.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
         this.gridColumn9,
         this.gridColumn10,
         this.gridColumn11,
         this.gridColumn12
     });
     this.gridView2.FocusRectStyle           = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFullFocus;
     this.gridView2.GridControl              = this.gridControl2;
     this.gridView2.Name                     = "gridView2";
     this.gridView2.OptionsBehavior.Editable = false;
     this.gridView2.OptionsCustomization.AllowColumnMoving     = false;
     this.gridView2.OptionsCustomization.AllowFilter           = false;
     this.gridView2.OptionsCustomization.AllowQuickHideColumns = false;
     this.gridView2.OptionsView.ShowGroupPanel  = false;
     this.gridView2.OptionsView.ShowViewCaption = true;
     this.gridView2.ViewCaption = "历史考试成绩";
     //
     // gridColumn9
     //
     this.gridColumn9.Caption      = "学号";
     this.gridColumn9.FieldName    = "TesterNO";
     this.gridColumn9.Name         = "gridColumn9";
     this.gridColumn9.Visible      = true;
     this.gridColumn9.VisibleIndex = 0;
     //
     // gridColumn10
     //
     this.gridColumn10.Caption      = "姓名";
     this.gridColumn10.FieldName    = "TesterName";
     this.gridColumn10.Name         = "gridColumn10";
     this.gridColumn10.Visible      = true;
     this.gridColumn10.VisibleIndex = 1;
     //
     // gridColumn11
     //
     this.gridColumn11.Caption      = "考核成绩";
     this.gridColumn11.FieldName    = "score";
     this.gridColumn11.Name         = "gridColumn11";
     this.gridColumn11.Visible      = true;
     this.gridColumn11.VisibleIndex = 2;
     //
     // gridColumn12
     //
     this.gridColumn12.Caption      = "考核时间";
     this.gridColumn12.FieldName    = "begintime";
     this.gridColumn12.Name         = "gridColumn12";
     this.gridColumn12.Visible      = true;
     this.gridColumn12.VisibleIndex = 3;
     //
     // gridColumn5
     //
     this.gridColumn5.Caption      = "编号";
     this.gridColumn5.Name         = "gridColumn5";
     this.gridColumn5.Visible      = true;
     this.gridColumn5.VisibleIndex = 0;
     //
     // gridColumn6
     //
     this.gridColumn6.Caption      = "测量对象";
     this.gridColumn6.Name         = "gridColumn6";
     this.gridColumn6.Visible      = true;
     this.gridColumn6.VisibleIndex = 1;
     //
     // gridColumn7
     //
     this.gridColumn7.Caption      = "测量参数";
     this.gridColumn7.Name         = "gridColumn7";
     this.gridColumn7.Visible      = true;
     this.gridColumn7.VisibleIndex = 2;
     //
     // gridColumn8
     //
     this.gridColumn8.Caption      = "测量值";
     this.gridColumn8.Name         = "gridColumn8";
     this.gridColumn8.Visible      = true;
     this.gridColumn8.VisibleIndex = 3;
     //
     // timer1
     //
     this.timer1.Interval = 3000;
     this.timer1.Tick    += new System.EventHandler(this.timer1_Tick);
     //
     // FrmCheckScore
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
     this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
     this.ClientSize          = new System.Drawing.Size(801, 465);
     this.Controls.Add(this.panelControl2);
     this.Controls.Add(this.panelControl1);
     this.Controls.Add(this.barDockControlLeft);
     this.Controls.Add(this.barDockControlRight);
     this.Controls.Add(this.barDockControlBottom);
     this.Controls.Add(this.barDockControlTop);
     this.Name  = "FrmCheckScore";
     this.Text  = "考核成绩查询";
     this.Load += new System.EventHandler(this.FrmCheckScore_Load);
     ((System.ComponentModel.ISupportInitialize)(this.barManager1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.gridControl1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.gridView1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.repositoryItemButtonEdit1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.panelControl1)).EndInit();
     this.panelControl1.ResumeLayout(false);
     ((System.ComponentModel.ISupportInitialize)(this.panelControl4)).EndInit();
     this.panelControl4.ResumeLayout(false);
     ((System.ComponentModel.ISupportInitialize)(this.panelControl3)).EndInit();
     this.panelControl3.ResumeLayout(false);
     this.panelControl3.PerformLayout();
     ((System.ComponentModel.ISupportInitialize)(this.textEdit1.Properties)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.comboBoxEdit1.Properties)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.panelControl2)).EndInit();
     this.panelControl2.ResumeLayout(false);
     ((System.ComponentModel.ISupportInitialize)(this.gridControl2)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.gridView2)).EndInit();
     this.ResumeLayout(false);
     this.PerformLayout();
 }
Exemple #39
0
        private void FillGrid()
        {
            gridMain.BeginUpdate();
            gridMain.ListGridColumns.Clear();
            GridColumn col;

            col = new GridColumn("User Name", 120);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("Group Name", 120);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("Show CDS", 80, HorizontalAlignment.Center);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("Show i", 80, HorizontalAlignment.Center);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("Edit CDS", 80, HorizontalAlignment.Center);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("Source", 80, HorizontalAlignment.Center);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("Problem", 80, HorizontalAlignment.Center);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("Medication", 80, HorizontalAlignment.Center);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("Allergy", 80, HorizontalAlignment.Center);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("Demographic", 80, HorizontalAlignment.Center);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("Labs", 80, HorizontalAlignment.Center);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("Vitals", 80, HorizontalAlignment.Center);
            gridMain.ListGridColumns.Add(col);
            gridMain.ListGridRows.Clear();
            GridRow       row;
            List <Userod> ListUsers = Userods.GetDeepCopy(true);

            UserGroup[] ArrayGroups = UserGroups.GetDeepCopy().ToArray();
            //if(radioUser.Checked) {//by user
            for (int i = 0; i < ListUsers.Count; i++)
            {
                row = new GridRow();
                row.Cells.Add(ListUsers[i].UserName);
                for (int g = 0; g < ArrayGroups.Length; g++)           //group name.
                {
                    if (!ListUsers[i].IsInUserGroup(ArrayGroups[g].UserGroupNum))
                    {
                        continue;
                    }
                    row.Cells.Add(ArrayGroups[g].Description);
                    break;
                }
                for (int p = 0; p < _listCdsPermissions.Count; p++)
                {
                    if (ListUsers[i].UserNum != _listCdsPermissions[p].UserNum)
                    {
                        continue;
                    }
                    row.Cells.Add((_listCdsPermissions[p].ShowCDS                                           ?"X":"")); //"X" if user has permission
                    row.Cells.Add((_listCdsPermissions[p].SetupCDS                                  ?"X":""));         //"X" if user has permission
                    row.Cells.Add((_listCdsPermissions[p].ShowInfobutton            ?"X":""));                         //"X" if user has permission
                    row.Cells.Add((_listCdsPermissions[p].EditBibliography  ?"X":""));                                 //"X" if user has permission
                    row.Cells.Add((_listCdsPermissions[p].ProblemCDS                                ?"X":""));         //"X" if user has permission
                    row.Cells.Add((_listCdsPermissions[p].MedicationCDS                     ?"X":""));                 //"X" if user has permission
                    row.Cells.Add((_listCdsPermissions[p].AllergyCDS                                ?"X":""));         //"X" if user has permission
                    row.Cells.Add((_listCdsPermissions[p].DemographicCDS            ?"X":""));                         //"X" if user has permission
                    row.Cells.Add((_listCdsPermissions[p].LabTestCDS                                ?"X":""));         //"X" if user has permission
                    row.Cells.Add((_listCdsPermissions[p].VitalCDS                                  ?"X":""));         //"X" if user has permission
                    row.Tag = _listCdsPermissions[p].CDSPermissionNum;                                                 //used to edit correct permission.
                    break;
                }
                gridMain.ListGridRows.Add(row);
            }
            //}
            //else {//by user group
            //	for(int g=0;g<ArrayGroups.Length;g++) {
            //		row=new ODGridRow();
            //		row.Cells.Add("");//No User Name
            //		row.Cells.Add(ArrayGroups[g].Description);
            //TODO: Later. No time now for group level permission editing.
            //		gridMain.Rows.Add(row);
            //	}
            //}
            gridMain.EndUpdate();
        }
Exemple #40
0
 public void ChangeFilterValue(GridColumn col, object value)
 {
     customChangeFilter = true;
     OnFilterRowValueChanging(col, value);
 }
Exemple #41
0
 public RepositoryItem GetRepositoryItem(GridColumn column, RepositoryItem current)
 {
     return(base.GetFilterRowRepositoryItem(column, current));
 }
Exemple #42
0
 public void DrawStatusColor(object sender, RowCellStyleEventArgs e, GridColumn colStatus, GridColumn colDisplayColor)
 {
     if (e.RowHandle < 0)
     {
         return;
     }
     if (e.Column == colDisplayColor)
     {
     }
 }
Exemple #43
0
 public MacCellFormatArgs(GridColumn column, object item, int row, NSCell cell)
     : base(column, item, row)
 {
     this.Cell = cell;
 }
        /// <summary>
        /// 以分组排度方式显示
        /// </summary>
        private void ChangeToGSMode()
        {
            if (gridControl1.DataSource == null)
            {
                return;
            }
            if (gridView1.GroupedColumns.Count < 1)
            {
                return;
            }

            gridControl1.Visible = false;
            //表名字典
            Hashtable _Gtable = new Hashtable();
            //字段名字典
            Hashtable _GTitle = new Hashtable();
            //分组排序数据集
            DataSet _GSDs = new DataSet();

            #region  制原数据记录表,以供关联数据使用
            DataTable _sourcedt = ((DataTable)gridControl1.DataSource).Copy();
            _sourcedt.CaseSensitive = true;
            foreach (DataColumn _dc in _sourcedt.Columns)
            {
                if (_dc.ReadOnly)
                {
                    _dc.ReadOnly = false;
                }
            }
            _GSDs.Merge(_sourcedt);
            #endregion


            #region 建分组排序表结构
            int TableCount = 0;
            foreach (GridColumn _gc in gridView1.GroupedColumns)
            {
                DataTable _dt = new DataTable();
                _dt.CaseSensitive = true;
                DataColumn[] keys = new DataColumn[TableCount + 1];
                for (int i = 0; i < TableCount; i++)
                {
                    DataColumn _sdc = (DataColumn)_Gtable[i];
                    DataColumn _dc  = _dt.Columns.Add(_sdc.ColumnName, _sdc.DataType);
                    _dc.AllowDBNull = true;
                    _dc.Caption     = _sdc.Caption;
                    keys[i]         = _dc;
                }
                DataColumn _newColumn = _dt.Columns.Add(_gc.FieldName, _gc.ColumnType);
                _newColumn.AllowDBNull = true;
                _newColumn.ReadOnly    = false;
                _newColumn.Caption     = _gc.Caption;
                keys[TableCount]       = _newColumn;
                _Gtable.Add(TableCount++, _newColumn);
                _GTitle.Add(_gc.FieldName, _gc.Caption);
                _dt.PrimaryKey = keys;
                string _tname = string.Format("Table_{0}", _gc.FieldName);
                _dt.TableName = _tname;
                _GSDs.Merge(_dt);
            }
            #endregion

            #region 加数据
            string   _sortstr   = "";
            object[] _oldValues = new object[TableCount];
            for (int i = 0; i < TableCount; i++)
            {
                _sortstr     += string.Format(",{0}", ((DataColumn)_Gtable[i]).ColumnName);
                _oldValues[i] = null;
            }
            if (_sortstr.Length > 1)
            {
                _sortstr = _sortstr.Substring(1);
            }

            DataView _rowview = _GSDs.Tables[0].DefaultView;
            _rowview.Sort = _sortstr;

            foreach (DataRowView myDRV in _rowview)
            {
                DataRow _drs = myDRV.Row;

                bool _isold = true;

                try
                {
                    for (int i = 0; i < TableCount; i++)
                    {
                        DataColumn _gCol    = (DataColumn)_Gtable[i];
                        string     _colname = _gCol.ColumnName;
                        if (_drs.IsNull(_colname))
                        {
                            if (_gCol.DataType == typeof(decimal))
                            {
                                _drs[_colname] = decimal.Zero;
                            }
                            if (_gCol.DataType == typeof(string))
                            {
                                _drs[_colname] = "<空值>";
                            }
                            if (_gCol.DataType == typeof(DateTime))
                            {
                                _drs[_colname] = DateTime.MinValue;
                            }
                        }
                        if (_oldValues[i] == null)
                        {
                            _oldValues[i] = _drs[_colname];
                            _isold        = false;
                        }
                        else
                        {
                            if (!_oldValues[i].Equals(_drs[_colname]))
                            {
                                _oldValues[i] = _drs[_colname];
                                _isold        = false;
                            }
                        }

                        if (!_isold)
                        {
                            string    _tname   = string.Format("Table_{0}", _colname);
                            DataTable _dtable  = _GSDs.Tables[_tname];
                            DataRow   foundRow = _dtable.NewRow();
                            for (int j = 0; j <= i; j++)
                            {
                                string _cn = ((DataColumn)_Gtable[j]).ColumnName;
                                foundRow[_cn] = _drs[_cn];
                            }
                            _dtable.Rows.Add(foundRow);
                        }
                    }
                }
                catch (Exception e)
                {
                    XtraMessageBox.Show(string.Format("分组项目格式非法,无法分组排序。\n描述:{0}", e.Message), "系统提示");
                }
            }
            #endregion

            #region 加关系
            for (int i = 0; i < TableCount; i++)
            {
                DataTable _ctable = null;
                string    _rName  = string.Format("详细信息{0}", "".PadLeft(i + 1));
                DataTable _ftable = _GSDs.Tables[string.Format("Table_{0}", ((DataColumn)_Gtable[i]).ColumnName)];
                if (i == (TableCount - 1))
                {
                    _ctable = _GSDs.Tables[0];
                }
                else
                {
                    _ctable = _GSDs.Tables[string.Format("Table_{0}", ((DataColumn)_Gtable[i + 1]).ColumnName)];
                }
                DataColumn[] _CFather = new DataColumn[i + 1];
                DataColumn[] _CChild  = new DataColumn[i + 1];
                for (int j = 0; j <= i; j++)
                {
                    DataColumn _gCol = (DataColumn)_Gtable[j];
                    _CFather[j] = _ftable.Columns[_gCol.ColumnName];
                    _CChild[j]  = _ctable.Columns[_gCol.ColumnName];
                }
                //DataTableSpyForm _ds = new DataTableSpyForm(_ftable);
                //_ds.ShowDialog();
                _GSDs.Relations.Add(_rName, _CFather, _CChild);
            }
            #endregion

            #region 加计算段

            GridGroupSummaryItemCollection _gsItem = gridView1.GroupSummary;
            foreach (GridSummaryItem _gi in _gsItem)
            {
                if (_gi.SummaryType != SummaryItemType.None)
                {
                    Type       _cType = _sourcedt.Columns[_gi.FieldName].DataType;
                    string     _normalExp = "", _endExp = "";
                    string     _Cfieldname    = string.Format("C_{0}", _gi.FieldName);
                    GridColumn _gridCol       = gridView1.Columns.ColumnByFieldName(_gi.FieldName);
                    string     _CfieldCaption = _gridCol.Caption + "_";

                    switch (_gi.SummaryType)
                    {
                    case SummaryItemType.Average:
                        _CfieldCaption += "平均值";
                        _normalExp      = string.Format("Avg(Child.{0})", _Cfieldname);
                        _endExp         = string.Format("Avg(Child.{0})", _gi.FieldName);
                        _cType          = typeof(Decimal);
                        break;

                    case SummaryItemType.Count:
                        _CfieldCaption += "个数";
                        _normalExp      = string.Format("Sum(Child.{0})", _Cfieldname);
                        _endExp         = string.Format("Count(Child.MAINID)", _gi.FieldName);
                        _cType          = typeof(Decimal);
                        break;

                    case SummaryItemType.Max:
                        _CfieldCaption += "最大值";
                        _normalExp      = string.Format("Max(Child.{0})", _Cfieldname);
                        _endExp         = string.Format("Max(Child.{0})", _gi.FieldName);
                        _cType          = _sourcedt.Columns[_gi.FieldName].DataType;
                        break;

                    case SummaryItemType.Min:
                        _CfieldCaption += "最小值";
                        _normalExp      = string.Format("Min(Child.{0})", _Cfieldname);
                        _endExp         = string.Format("Min(Child.{0})", _gi.FieldName);
                        _cType          = _sourcedt.Columns[_gi.FieldName].DataType;
                        break;

                    case SummaryItemType.Sum:
                        _CfieldCaption += "总和";
                        _normalExp      = string.Format("Sum(Child.{0})", _Cfieldname);
                        _endExp         = string.Format("Sum(Child.{0})", _gi.FieldName);
                        _cType          = typeof(Decimal);
                        break;

                    case SummaryItemType.None:
                        _CfieldCaption += "";
                        _normalExp      = "";
                        _endExp         = "";
                        break;
                    }
                    if (_GTitle[_Cfieldname] == null)
                    {
                        _GTitle.Add(_Cfieldname, _CfieldCaption);
                    }
                    for (int i = (TableCount - 1); i >= 0; i--)
                    {
                        DataColumn _ncol = null;
                        DataTable  _dt2  = _GSDs.Tables[string.Format("Table_{0}", ((DataColumn)_Gtable[i]).ColumnName)];
                        if (i < (TableCount - 1))
                        {
                            _ncol = _dt2.Columns.Add(_Cfieldname, _cType, _normalExp);
                        }
                        else
                        {
                            _ncol = _dt2.Columns.Add(_Cfieldname, _cType, _endExp);
                        }
                        _ncol.Caption = _GTitle[_Cfieldname].ToString();
                    }
                }
            }

            #endregion

            DataViewManager dvManager = new DataViewManager(_GSDs);
            string          _tname1   = string.Format("Table_{0}", ((DataColumn)_Gtable[0]).ColumnName);
            DataView        dv        = dvManager.CreateDataView(_GSDs.Tables[_tname1]);
            gridView2.Columns.Clear();
            gridControl2.DataSource       = dv;
            this.gridView2.IndicatorWidth = this.gridView2.RowCount.ToString().Length * 10 + 20;
            foreach (GridColumn _dcc in gridView2.Columns)
            {
                if (_GTitle[_dcc.FieldName] != null)
                {
                    _dcc.Caption = _GTitle[_dcc.FieldName].ToString();
                }
                _dcc.BestFit();
                _dcc.OptionsColumn.ReadOnly = true;
            }
            gridControl2.Visible = true;
        }
Exemple #45
0
        private void InitializeComponent()
        {
            ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof(frmHLSYZZ));

            this.panelcondition    = new Panel();
            this.label1            = new Label();
            this.btnReset          = new Button();
            this.btnSearch         = new Button();
            this.txtYXCF           = new TextBox();
            this.paneldata         = new Panel();
            this.gridControl1      = new GridControl();
            this.gridView1         = new GridView();
            this.gridColumn1       = new GridColumn();
            this.gridColumn2       = new GridColumn();
            this.gridColumn3       = new GridColumn();
            this.gridColumn4       = new GridColumn();
            this.gridColumn5       = new GridColumn();
            this.gridColumn6       = new GridColumn();
            this.gridColumn7       = new GridColumn();
            this.gridColumn8       = new GridColumn();
            this.gridColumn9       = new GridColumn();
            this.gridColumn10      = new GridColumn();
            this.gridColumn11      = new GridColumn();
            this.panelmenu         = new Panel();
            this.userManu1         = new UserManu();
            this.paneltop_right    = new Panel();
            this.paneltop_middle   = new Panel();
            this.paneltop_left     = new Panel();
            this.paneltitle_right  = new Panel();
            this.pictureBox3       = new PictureBox();
            this.pictureBox2       = new PictureBox();
            this.pictureBox1       = new PictureBox();
            this.paneltitle_middle = new Panel();
            this.paneltitle_left   = new Panel();
            this.panelright        = new Panel();
            this.panelwhite        = new Panel();
            this.panelbutton       = new Panel();
            this.pictureBox_sum    = new PictureBox();
            this.pictureBox_view   = new PictureBox();
            this.pictureBox_sort   = new PictureBox();
            this.pictureBox_filter = new PictureBox();
            this.paneldatasum      = new Panel();
            this.labeldatacount    = new Label();
            this.pictureBox_right  = new PictureBox();
            this.panel_middle      = new Panel();
            this.label6            = new Label();
            this.pictureBox_left   = new PictureBox();
            this.panelcondition.SuspendLayout();
            this.paneldata.SuspendLayout();
            ((ISupportInitialize)this.gridControl1).BeginInit();
            ((ISupportInitialize)this.gridView1).BeginInit();
            this.panelmenu.SuspendLayout();
            this.paneltitle_right.SuspendLayout();
            ((ISupportInitialize)this.pictureBox3).BeginInit();
            ((ISupportInitialize)this.pictureBox2).BeginInit();
            ((ISupportInitialize)this.pictureBox1).BeginInit();
            this.panelright.SuspendLayout();
            this.panelwhite.SuspendLayout();
            this.panelbutton.SuspendLayout();
            ((ISupportInitialize)this.pictureBox_sum).BeginInit();
            ((ISupportInitialize)this.pictureBox_view).BeginInit();
            ((ISupportInitialize)this.pictureBox_sort).BeginInit();
            ((ISupportInitialize)this.pictureBox_filter).BeginInit();
            this.paneldatasum.SuspendLayout();
            ((ISupportInitialize)this.pictureBox_right).BeginInit();
            this.panel_middle.SuspendLayout();
            ((ISupportInitialize)this.pictureBox_left).BeginInit();
            base.SuspendLayout();
            this.panelcondition.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
            this.panelcondition.Controls.Add(this.label1);
            this.panelcondition.Controls.Add(this.btnReset);
            this.panelcondition.Controls.Add(this.btnSearch);
            this.panelcondition.Controls.Add(this.txtYXCF);
            this.panelcondition.Location           = new Point(3, 37);
            this.panelcondition.Name               = "panelcondition";
            this.panelcondition.Size               = new Size(600, 80);
            this.panelcondition.TabIndex           = 17;
            this.label1.AutoSize                   = true;
            this.label1.BackColor                  = Color.Transparent;
            this.label1.Font                       = new Font("宋体", 10.5f, FontStyle.Regular, GraphicsUnit.Point, 134);
            this.label1.Location                   = new Point(1, 15);
            this.label1.Name                       = "label1";
            this.label1.Size                       = new Size(63, 14);
            this.label1.TabIndex                   = 2;
            this.label1.Text                       = "有效成分";
            this.btnReset.Location                 = new Point(71, 49);
            this.btnReset.Name                     = "btnReset";
            this.btnReset.Size                     = new Size(50, 23);
            this.btnReset.TabIndex                 = 19;
            this.btnReset.Text                     = "重置";
            this.btnReset.UseVisualStyleBackColor  = true;
            this.btnReset.Click                   += new EventHandler(this.btnReset_Click);
            this.btnSearch.Location                = new Point(15, 49);
            this.btnSearch.Name                    = "btnSearch";
            this.btnSearch.Size                    = new Size(50, 23);
            this.btnSearch.TabIndex                = 18;
            this.btnSearch.Text                    = "查询";
            this.btnSearch.UseVisualStyleBackColor = true;
            this.btnSearch.Click                  += new EventHandler(this.btnSearch_Click);
            this.txtYXCF.Font                      = new Font("宋体", 10.5f, FontStyle.Regular, GraphicsUnit.Point, 134);
            this.txtYXCF.ImeMode                   = ImeMode.On;
            this.txtYXCF.Location                  = new Point(64, 11);
            this.txtYXCF.Name                      = "txtYXCF";
            this.txtYXCF.Size                      = new Size(406, 23);
            this.txtYXCF.TabIndex                  = 1;
            this.paneldata.Anchor                  = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
            this.paneldata.Controls.Add(this.gridControl1);
            this.paneldata.Location    = new Point(16, 301);
            this.paneldata.Name        = "paneldata";
            this.paneldata.Size        = new Size(141, 43);
            this.paneldata.TabIndex    = 26;
            this.gridControl1.Dock     = DockStyle.Fill;
            this.gridControl1.Location = new Point(0, 0);
            this.gridControl1.MainView = this.gridView1;
            this.gridControl1.Name     = "gridControl1";
            this.gridControl1.Size     = new Size(141, 43);
            this.gridControl1.TabIndex = 17;
            this.gridControl1.ViewCollection.AddRange(new BaseView[]
            {
                this.gridView1
            });
            this.gridView1.Columns.AddRange(new GridColumn[]
            {
                this.gridColumn1,
                this.gridColumn2,
                this.gridColumn3,
                this.gridColumn4,
                this.gridColumn5,
                this.gridColumn6,
                this.gridColumn7,
                this.gridColumn8,
                this.gridColumn9,
                this.gridColumn10,
                this.gridColumn11
            });
            this.gridView1.GridControl             = this.gridControl1;
            this.gridView1.Name                    = "gridView1";
            this.gridView1.CustomDrawRowIndicator += new RowIndicatorCustomDrawEventHandler(this.gridView1_CustomDrawRowIndicator);
            this.gridView1.RowCountChanged        += new EventHandler(this.gridView1_RowCountChanged);
            this.gridColumn1.Caption               = "gridColumn1";
            this.gridColumn1.Name                  = "gridColumn1";
            this.gridColumn1.Visible               = true;
            this.gridColumn1.VisibleIndex          = 0;
            this.gridColumn2.Caption               = "gridColumn2";
            this.gridColumn2.Name                  = "gridColumn2";
            this.gridColumn2.Visible               = true;
            this.gridColumn2.VisibleIndex          = 1;
            this.gridColumn3.Caption               = "gridColumn3";
            this.gridColumn3.Name                  = "gridColumn3";
            this.gridColumn3.Visible               = true;
            this.gridColumn3.VisibleIndex          = 2;
            this.gridColumn4.Caption               = "gridColumn4";
            this.gridColumn4.Name                  = "gridColumn4";
            this.gridColumn4.Visible               = true;
            this.gridColumn4.VisibleIndex          = 3;
            this.gridColumn5.Caption               = "gridColumn5";
            this.gridColumn5.Name                  = "gridColumn5";
            this.gridColumn5.Visible               = true;
            this.gridColumn5.VisibleIndex          = 4;
            this.gridColumn6.Caption               = "gridColumn6";
            this.gridColumn6.Name                  = "gridColumn6";
            this.gridColumn6.Visible               = true;
            this.gridColumn6.VisibleIndex          = 5;
            this.gridColumn7.Caption               = "gridColumn7";
            this.gridColumn7.Name                  = "gridColumn7";
            this.gridColumn7.Visible               = true;
            this.gridColumn7.VisibleIndex          = 6;
            this.gridColumn8.Caption               = "gridColumn8";
            this.gridColumn8.Name                  = "gridColumn8";
            this.gridColumn8.Visible               = true;
            this.gridColumn8.VisibleIndex          = 7;
            this.gridColumn9.Caption               = "gridColumn9";
            this.gridColumn9.Name                  = "gridColumn9";
            this.gridColumn9.Visible               = true;
            this.gridColumn9.VisibleIndex          = 8;
            this.gridColumn10.Caption              = "gridColumn10";
            this.gridColumn10.Name                 = "gridColumn10";
            this.gridColumn10.Visible              = true;
            this.gridColumn10.VisibleIndex         = 9;
            this.gridColumn11.Caption              = "gridColumn11";
            this.gridColumn11.Name                 = "gridColumn11";
            this.gridColumn11.Visible              = true;
            this.gridColumn11.VisibleIndex         = 10;
            this.panelmenu.Anchor                  = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left);
            this.panelmenu.Controls.Add(this.userManu1);
            this.panelmenu.Location       = new Point(2, 123);
            this.panelmenu.Name           = "panelmenu";
            this.panelmenu.Size           = new Size(149, 442);
            this.panelmenu.TabIndex       = 28;
            this.userManu1.BackColor      = Color.FromArgb(107, 161, 179);
            this.userManu1.Dock           = DockStyle.Fill;
            this.userManu1.Location       = new Point(0, 0);
            this.userManu1.Name           = "userManu1";
            this.userManu1.Size           = new Size(149, 442);
            this.userManu1.TabIndex       = 0;
            this.paneltop_right.Anchor    = (AnchorStyles.Top | AnchorStyles.Right);
            this.paneltop_right.Location  = new Point(373, 35);
            this.paneltop_right.Name      = "paneltop_right";
            this.paneltop_right.Size      = new Size(407, 25);
            this.paneltop_right.TabIndex  = 34;
            this.paneltop_middle.Anchor   = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
            this.paneltop_middle.Location = new Point(197, 31);
            this.paneltop_middle.Name     = "paneltop_middle";
            this.paneltop_middle.Size     = new Size(165, 29);
            this.paneltop_middle.TabIndex = 33;
            this.paneltop_left.Location   = new Point(14, 31);
            this.paneltop_left.Name       = "paneltop_left";
            this.paneltop_left.Size       = new Size(185, 29);
            this.paneltop_left.TabIndex   = 32;
            this.paneltitle_right.Anchor  = (AnchorStyles.Top | AnchorStyles.Right);
            this.paneltitle_right.Controls.Add(this.pictureBox3);
            this.paneltitle_right.Controls.Add(this.pictureBox2);
            this.paneltitle_right.Controls.Add(this.pictureBox1);
            this.paneltitle_right.Location    = new Point(543, 2);
            this.paneltitle_right.Name        = "paneltitle_right";
            this.paneltitle_right.Size        = new Size(237, 25);
            this.paneltitle_right.TabIndex    = 31;
            this.pictureBox3.Anchor           = (AnchorStyles.Top | AnchorStyles.Right);
            this.pictureBox3.Image            = (Image)componentResourceManager.GetObject("pictureBox3.Image");
            this.pictureBox3.Location         = new Point(170, 2);
            this.pictureBox3.Name             = "pictureBox3";
            this.pictureBox3.Size             = new Size(21, 21);
            this.pictureBox3.SizeMode         = PictureBoxSizeMode.AutoSize;
            this.pictureBox3.TabIndex         = 23;
            this.pictureBox3.TabStop          = false;
            this.pictureBox3.MouseLeave      += new EventHandler(this.pictureBox3_MouseLeave);
            this.pictureBox3.Click           += new EventHandler(this.pictureBox3_Click);
            this.pictureBox3.MouseEnter      += new EventHandler(this.pictureBox3_MouseEnter);
            this.pictureBox2.Anchor           = (AnchorStyles.Top | AnchorStyles.Right);
            this.pictureBox2.Image            = (Image)componentResourceManager.GetObject("pictureBox2.Image");
            this.pictureBox2.Location         = new Point(192, 2);
            this.pictureBox2.Name             = "pictureBox2";
            this.pictureBox2.Size             = new Size(21, 21);
            this.pictureBox2.SizeMode         = PictureBoxSizeMode.AutoSize;
            this.pictureBox2.TabIndex         = 22;
            this.pictureBox2.TabStop          = false;
            this.pictureBox2.MouseLeave      += new EventHandler(this.pictureBox2_MouseLeave);
            this.pictureBox2.Click           += new EventHandler(this.pictureBox2_Click);
            this.pictureBox2.MouseEnter      += new EventHandler(this.pictureBox2_MouseEnter);
            this.pictureBox1.Anchor           = (AnchorStyles.Top | AnchorStyles.Right);
            this.pictureBox1.Image            = (Image)componentResourceManager.GetObject("pictureBox1.Image");
            this.pictureBox1.Location         = new Point(214, 2);
            this.pictureBox1.Name             = "pictureBox1";
            this.pictureBox1.Size             = new Size(21, 21);
            this.pictureBox1.SizeMode         = PictureBoxSizeMode.AutoSize;
            this.pictureBox1.TabIndex         = 21;
            this.pictureBox1.TabStop          = false;
            this.pictureBox1.MouseLeave      += new EventHandler(this.pictureBox1_MouseLeave);
            this.pictureBox1.Click           += new EventHandler(this.pictureBox1_Click);
            this.pictureBox1.MouseEnter      += new EventHandler(this.pictureBox1_MouseEnter);
            this.paneltitle_middle.Anchor     = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
            this.paneltitle_middle.Location   = new Point(266, 2);
            this.paneltitle_middle.Name       = "paneltitle_middle";
            this.paneltitle_middle.Size       = new Size(280, 25);
            this.paneltitle_middle.TabIndex   = 30;
            this.paneltitle_middle.MouseMove += new MouseEventHandler(this.paneltitle_middle_MouseMove);
            this.paneltitle_middle.MouseDown += new MouseEventHandler(this.paneltitle_middle_MouseDown);
            this.paneltitle_middle.MouseUp   += new MouseEventHandler(this.paneltitle_middle_MouseUp);
            this.paneltitle_left.Location     = new Point(2, 2);
            this.paneltitle_left.Name         = "paneltitle_left";
            this.paneltitle_left.Size         = new Size(264, 25);
            this.paneltitle_left.TabIndex     = 29;
            this.panelright.Anchor            = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
            this.panelright.Controls.Add(this.panelwhite);
            this.panelright.Controls.Add(this.pictureBox_right);
            this.panelright.Controls.Add(this.panel_middle);
            this.panelright.Controls.Add(this.pictureBox_left);
            this.panelright.Controls.Add(this.panelcondition);
            this.panelright.Location = new Point(174, 66);
            this.panelright.Name     = "panelright";
            this.panelright.Size     = new Size(606, 488);
            this.panelright.TabIndex = 35;
            this.panelwhite.Anchor   = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
            this.panelwhite.Controls.Add(this.panelbutton);
            this.panelwhite.Controls.Add(this.paneldatasum);
            this.panelwhite.Controls.Add(this.paneldata);
            this.panelwhite.Location = new Point(7, 123);
            this.panelwhite.Name     = "panelwhite";
            this.panelwhite.Size     = new Size(592, 362);
            this.panelwhite.TabIndex = 30;
            this.panelbutton.Anchor  = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
            this.panelbutton.Controls.Add(this.pictureBox_sum);
            this.panelbutton.Controls.Add(this.pictureBox_view);
            this.panelbutton.Controls.Add(this.pictureBox_sort);
            this.panelbutton.Controls.Add(this.pictureBox_filter);
            this.panelbutton.Location        = new Point(3, 37);
            this.panelbutton.Name            = "panelbutton";
            this.panelbutton.Size            = new Size(572, 40);
            this.panelbutton.TabIndex        = 28;
            this.pictureBox_sum.BackColor    = Color.Transparent;
            this.pictureBox_sum.Cursor       = Cursors.Hand;
            this.pictureBox_sum.Location     = new Point(352, 9);
            this.pictureBox_sum.Name         = "pictureBox_sum";
            this.pictureBox_sum.Size         = new Size(65, 24);
            this.pictureBox_sum.SizeMode     = PictureBoxSizeMode.AutoSize;
            this.pictureBox_sum.TabIndex     = 3;
            this.pictureBox_sum.TabStop      = false;
            this.pictureBox_sum.Visible      = false;
            this.pictureBox_view.BackColor   = Color.Transparent;
            this.pictureBox_view.Cursor      = Cursors.Hand;
            this.pictureBox_view.Location    = new Point(253, 9);
            this.pictureBox_view.Name        = "pictureBox_view";
            this.pictureBox_view.Size        = new Size(65, 24);
            this.pictureBox_view.SizeMode    = PictureBoxSizeMode.AutoSize;
            this.pictureBox_view.TabIndex    = 2;
            this.pictureBox_view.TabStop     = false;
            this.pictureBox_view.Click      += new EventHandler(this.pictureBox_view_Click);
            this.pictureBox_sort.BackColor   = Color.Transparent;
            this.pictureBox_sort.Cursor      = Cursors.Hand;
            this.pictureBox_sort.Location    = new Point(154, 9);
            this.pictureBox_sort.Name        = "pictureBox_sort";
            this.pictureBox_sort.Size        = new Size(65, 24);
            this.pictureBox_sort.SizeMode    = PictureBoxSizeMode.AutoSize;
            this.pictureBox_sort.TabIndex    = 1;
            this.pictureBox_sort.TabStop     = false;
            this.pictureBox_sort.Click      += new EventHandler(this.pictureBox_sort_Click);
            this.pictureBox_filter.BackColor = Color.Transparent;
            this.pictureBox_filter.Cursor    = Cursors.Hand;
            this.pictureBox_filter.Location  = new Point(55, 9);
            this.pictureBox_filter.Name      = "pictureBox_filter";
            this.pictureBox_filter.Size      = new Size(65, 24);
            this.pictureBox_filter.SizeMode  = PictureBoxSizeMode.AutoSize;
            this.pictureBox_filter.TabIndex  = 0;
            this.pictureBox_filter.TabStop   = false;
            this.pictureBox_filter.Click    += new EventHandler(this.pictureBox_filter_Click);
            this.paneldatasum.Anchor         = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
            this.paneldatasum.Controls.Add(this.labeldatacount);
            this.paneldatasum.Location     = new Point(3, 3);
            this.paneldatasum.Name         = "paneldatasum";
            this.paneldatasum.Size         = new Size(572, 28);
            this.paneldatasum.TabIndex     = 27;
            this.labeldatacount.BackColor  = Color.Transparent;
            this.labeldatacount.Font       = new Font("宋体", 10.5f, FontStyle.Regular, GraphicsUnit.Point, 134);
            this.labeldatacount.Location   = new Point(41, 8);
            this.labeldatacount.Name       = "labeldatacount";
            this.labeldatacount.Size       = new Size(253, 14);
            this.labeldatacount.TabIndex   = 0;
            this.pictureBox_right.Anchor   = (AnchorStyles.Top | AnchorStyles.Right);
            this.pictureBox_right.Location = new Point(561, 3);
            this.pictureBox_right.Name     = "pictureBox_right";
            this.pictureBox_right.Size     = new Size(38, 28);
            this.pictureBox_right.SizeMode = PictureBoxSizeMode.AutoSize;
            this.pictureBox_right.TabIndex = 29;
            this.pictureBox_right.TabStop  = false;
            this.panel_middle.Anchor       = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
            this.panel_middle.Controls.Add(this.label6);
            this.panel_middle.Location    = new Point(74, 3);
            this.panel_middle.Name        = "panel_middle";
            this.panel_middle.Size        = new Size(328, 28);
            this.panel_middle.TabIndex    = 28;
            this.label6.BackColor         = Color.Transparent;
            this.label6.Font              = new Font("宋体", 10.5f, FontStyle.Bold, GraphicsUnit.Point, 134);
            this.label6.Location          = new Point(41, 7);
            this.label6.Name              = "label6";
            this.label6.Size              = new Size(253, 14);
            this.label6.TabIndex          = 1;
            this.label6.Text              = "合理使用准则";
            this.pictureBox_left.Location = new Point(5, 3);
            this.pictureBox_left.Name     = "pictureBox_left";
            this.pictureBox_left.Size     = new Size(17, 28);
            this.pictureBox_left.SizeMode = PictureBoxSizeMode.AutoSize;
            this.pictureBox_left.TabIndex = 27;
            this.pictureBox_left.TabStop  = false;
            base.AcceptButton             = this.btnSearch;
            base.AutoScaleMode            = AutoScaleMode.None;
            base.ClientSize = new Size(792, 566);
            base.Controls.Add(this.panelright);
            base.Controls.Add(this.paneltop_right);
            base.Controls.Add(this.paneltop_middle);
            base.Controls.Add(this.paneltop_left);
            base.Controls.Add(this.paneltitle_right);
            base.Controls.Add(this.paneltitle_middle);
            base.Controls.Add(this.paneltitle_left);
            base.Controls.Add(this.panelmenu);
            this.Font            = new Font("宋体", 10f, FontStyle.Regular, GraphicsUnit.Point, 134);
            base.FormBorderStyle = FormBorderStyle.None;
            base.Icon            = (Icon)componentResourceManager.GetObject("$this.Icon");
            base.Name            = "frmHLSYZZ";
            base.ShowInTaskbar   = false;
            this.Text            = "合理使用准则";
            base.WindowState     = FormWindowState.Maximized;
            base.Load           += new EventHandler(this.frmHLSYZZ_Load);
            base.Resize         += new EventHandler(this.frmHLSYZZ_Resize);
            this.panelcondition.ResumeLayout(false);
            this.panelcondition.PerformLayout();
            this.paneldata.ResumeLayout(false);
            ((ISupportInitialize)this.gridControl1).EndInit();
            ((ISupportInitialize)this.gridView1).EndInit();
            this.panelmenu.ResumeLayout(false);
            this.paneltitle_right.ResumeLayout(false);
            this.paneltitle_right.PerformLayout();
            ((ISupportInitialize)this.pictureBox3).EndInit();
            ((ISupportInitialize)this.pictureBox2).EndInit();
            ((ISupportInitialize)this.pictureBox1).EndInit();
            this.panelright.ResumeLayout(false);
            this.panelright.PerformLayout();
            this.panelwhite.ResumeLayout(false);
            this.panelbutton.ResumeLayout(false);
            this.panelbutton.PerformLayout();
            ((ISupportInitialize)this.pictureBox_sum).EndInit();
            ((ISupportInitialize)this.pictureBox_view).EndInit();
            ((ISupportInitialize)this.pictureBox_sort).EndInit();
            ((ISupportInitialize)this.pictureBox_filter).EndInit();
            this.paneldatasum.ResumeLayout(false);
            ((ISupportInitialize)this.pictureBox_right).EndInit();
            this.panel_middle.ResumeLayout(false);
            ((ISupportInitialize)this.pictureBox_left).EndInit();
            base.ResumeLayout(false);
        }
Exemple #46
0
        private void InitializeComponent()
        {
            this.gcSnapPro   = new GridControl();
            this.gridView1   = new GridView();
            this.gcLayerName = new GridColumn();
            this.gcVertex    = new GridColumn();
            this.repositoryItemCheckEdit1 = new RepositoryItemCheckEdit();
            this.gcEdge     = new GridColumn();
            this.gcEndPoint = new GridColumn();
            this.btMoveDown = new SimpleButton();
            this.btMoveUp   = new SimpleButton();
            this.ceSnapTip  = new CheckEdit();
            this.btApply    = new SimpleButton();
            this.btClose    = new SimpleButton();
            this.gcSnapPro.BeginInit();
            this.gridView1.BeginInit();
            this.repositoryItemCheckEdit1.BeginInit();
            this.ceSnapTip.Properties.BeginInit();
            base.SuspendLayout();
            this.gcSnapPro.Location = new Point(2, 2);
            this.gcSnapPro.MainView = this.gridView1;
            this.gcSnapPro.Name     = "gcSnapPro";
            this.gcSnapPro.RepositoryItems.AddRange(new RepositoryItem[] { this.repositoryItemCheckEdit1 });
            this.gcSnapPro.Size     = new Size(0x14e, 0xe9);
            this.gcSnapPro.TabIndex = 0;
            this.gcSnapPro.ViewCollection.AddRange(new BaseView[] { this.gridView1 });
            this.gridView1.Columns.AddRange(new GridColumn[] { this.gcLayerName, this.gcVertex, this.gcEdge, this.gcEndPoint });
            this.gridView1.GridControl = this.gcSnapPro;
            this.gridView1.Name        = "gridView1";
            this.gridView1.OptionsCustomization.AllowColumnMoving = false;
            this.gridView1.OptionsCustomization.AllowFilter       = false;
            this.gridView1.OptionsCustomization.AllowGroup        = false;
            this.gridView1.OptionsCustomization.AllowRowSizing    = true;
            this.gridView1.OptionsCustomization.AllowSort         = false;
            this.gridView1.OptionsMenu.EnableColumnMenu           = false;
            this.gridView1.OptionsMenu.EnableFooterMenu           = false;
            this.gridView1.OptionsMenu.EnableGroupPanelMenu       = false;
            this.gridView1.OptionsView.ShowGroupPanel             = false;
            this.gridView1.OptionsView.ShowHorzLines    = false;
            this.gridView1.OptionsView.ShowIndicator    = false;
            this.gridView1.OptionsView.ShowPreviewLines = false;
            this.gridView1.OptionsView.ShowVertLines    = false;
            this.gcLayerName.Caption   = "图层";
            this.gcLayerName.FieldName = "FeatureLayerName";
            this.gcLayerName.Name      = "gcLayerName";
            this.gcLayerName.OptionsColumn.AllowEdit = false;
            this.gcLayerName.Visible                 = true;
            this.gcLayerName.VisibleIndex            = 0;
            this.gcVertex.Caption                    = "顶点";
            this.gcVertex.ColumnEdit                 = this.repositoryItemCheckEdit1;
            this.gcVertex.FieldName                  = "Vertex";
            this.gcVertex.Name                       = "gcVertex";
            this.gcVertex.Visible                    = true;
            this.gcVertex.VisibleIndex               = 1;
            this.repositoryItemCheckEdit1.AutoHeight = false;
            this.repositoryItemCheckEdit1.Name       = "repositoryItemCheckEdit1";
            this.gcEdge.Caption                      = "边";
            this.gcEdge.ColumnEdit                   = this.repositoryItemCheckEdit1;
            this.gcEdge.FieldName                    = "Edge";
            this.gcEdge.Name                     = "gcEdge";
            this.gcEdge.Visible                  = true;
            this.gcEdge.VisibleIndex             = 2;
            this.gcEndPoint.Caption              = "端点";
            this.gcEndPoint.ColumnEdit           = this.repositoryItemCheckEdit1;
            this.gcEndPoint.FieldName            = "EndPoint";
            this.gcEndPoint.Name                 = "gcEndPoint";
            this.gcEndPoint.Visible              = true;
            this.gcEndPoint.VisibleIndex         = 3;
            this.btMoveDown.Location             = new Point(0x164, 0x7a);
            this.btMoveDown.Name                 = "btMoveDown";
            this.btMoveDown.Size                 = new Size(0x3d, 0x1b);
            this.btMoveDown.TabIndex             = 2;
            this.btMoveDown.Text                 = "下移";
            this.btMoveDown.Click               += new EventHandler(this.btMoveDown_Click);
            this.btMoveUp.Location               = new Point(0x165, 0x57);
            this.btMoveUp.Name                   = "btMoveUp";
            this.btMoveUp.Size                   = new Size(0x3b, 0x1b);
            this.btMoveUp.TabIndex               = 3;
            this.btMoveUp.Text                   = "上移";
            this.btMoveUp.Click                 += new EventHandler(this.btMoveUp_Click);
            this.ceSnapTip.Location              = new Point(0x152, 14);
            this.ceSnapTip.Name                  = "ceSnapTip";
            this.ceSnapTip.Properties.Caption    = "显示捕捉信息";
            this.ceSnapTip.Size                  = new Size(0x6c, 0x13);
            this.ceSnapTip.TabIndex              = 9;
            this.btApply.Location                = new Point(0x164, 0x9c);
            this.btApply.Name                    = "btApply";
            this.btApply.Size                    = new Size(0x3d, 0x1b);
            this.btApply.TabIndex                = 10;
            this.btApply.Text                    = "应用";
            this.btApply.Click                  += new EventHandler(this.btApply_Click);
            this.btClose.Location                = new Point(0x164, 190);
            this.btClose.Name                    = "btClose";
            this.btClose.Size                    = new Size(0x3d, 0x1b);
            this.btClose.TabIndex                = 11;
            this.btClose.Text                    = "关闭";
            this.btClose.Click                  += new EventHandler(this.btClose_Click);
            base.Appearance.BackColor            = Color.FromArgb(0xe3, 0xf1, 0xfe);
            base.Appearance.Options.UseBackColor = true;
            base.AutoScaleDimensions             = new SizeF(7f, 14f);
//            base.AutoScaleMode = AutoScaleMode.Font;
            base.ClientSize = new Size(0x1bc, 0xed);
            base.Controls.Add(this.btClose);
            base.Controls.Add(this.btApply);
            base.Controls.Add(this.ceSnapTip);
            base.Controls.Add(this.btMoveUp);
            base.Controls.Add(this.btMoveDown);
            base.Controls.Add(this.gcSnapPro);
//            base.FormBorderStyle = FormBorderStyle.FixedSingle;
            base.LookAndFeel.SkinName = "Blue";
            base.MaximizeBox          = false;
            base.MinimizeBox          = false;
            base.Name          = "SnapProperty";
            base.ShowInTaskbar = false;
            base.StartPosition = FormStartPosition.CenterParent;
            this.Text          = "捕捉属性";
            this.gcSnapPro.EndInit();
            this.gridView1.EndInit();
            this.repositoryItemCheckEdit1.EndInit();
            this.ceSnapTip.Properties.EndInit();
            base.ResumeLayout(false);
        }
Exemple #47
0
        /// <summary>
        /// 수정함수
        /// </summary>
        private void Updates()
        {
            try
            {
                ///TDDO:[메이드등록]수정

                //유효성 검사후 실행합니다.
                if(!ISCheckData(JobStyle.UPDATE)) return;
                Basic.SetCursor(this, false);
                Basic.LoadParentFunction(this, "수정 중 입니다..", true);

                string maidid       = this.gridView.GetRowCellValue(this.gridView.FocusedRowHandle, "MAID_NO").ToString().Trim();
                string mainname     = this.txtMaidname.Text.Trim();
                string regdate      = Convert.ToDateTime(this.dtpRegdate.EditValue.ToString()).ToString("yyyyMMdd");
                string idno         = Basic.MaskReplace(this.txtIdno.Text.Trim());
                string telno        = this.txtTelno.Text.Trim();
                string lupmaincode  = this.lupMaidcode.EditValue.ToString().Trim();
                string remark       = this.txtRmrk.Text.Trim();
                //수정함수를 구현합니다. 
                //만약 변수가 필요없다면 아래 코드를 삭제 하세요
                DataTable dtparmUpdate = DataLayer.GetDataTableParameter(DataLayer.DatatableStyle.Parameter);
                dtparmUpdate.TableName = "PKG_DAAAI06.PR_04";
                dtparmUpdate.Rows.Add(new object[] { "V_MAID_NO"   , maidid  });
                dtparmUpdate.Rows.Add(new object[] { "V_MAID_NAME" , mainname  });
                dtparmUpdate.Rows.Add(new object[] { "V_ID_NO"     , idno  });
                dtparmUpdate.Rows.Add(new object[] { "V_TEL_NO"    , telno  });
                dtparmUpdate.Rows.Add(new object[] { "V_REG_DATE"  , regdate  });
                dtparmUpdate.Rows.Add(new object[] { "V_MAID_CODE" , lupmaincode  });
                dtparmUpdate.Rows.Add(new object[] { "V_RMRK"      , remark  });
                dtparmUpdate.Rows.Add(new object[] { "V_U_EMP_NO"  , BizCommon.Parm.CurrentUserInformation.id  });
                dtparmUpdate.Rows.Add(new object[] { "V_U_IP"      , BizCommon.Parm.CurrentUserInformation.ip  });


                DataTable dtparmDelete = DataLayer.GetDataTableParameter(DataLayer.DatatableStyle.Parameter);
                dtparmDelete.Rows.Add(new object[] { "V_MAID_NO" , maidid  });
                dtparmDelete.TableName = "PKG_DAAAI06.PR_07";

                DataRow[] r = dtfacility.Select("CHK = 'Y'");

                DataTable[]  dtProcedure = new DataTable[r.Length + 2];
                dtProcedure[0] = dtparmUpdate.Copy();
                dtProcedure[1] = dtparmDelete.Copy(); 

                 for(int i = 0; i < r.Length; i++)
                {
                    string failitycode = r[i]["FACILITY_CODE"].ToString().Trim();

                    dtProcedure[i + 2] = DataLayer.GetDataTableParameter(DataLayer.DatatableStyle.Parameter);
                    dtProcedure[i + 2].TableName = "PKG_DAAAI06.PR_06";
                    dtProcedure[i + 2].Rows.Add(new object[] { "V_BIZ_CODE"      , Parm.CurrentUserInformation.BizInfo.BizCode });
                    dtProcedure[i + 2].Rows.Add(new object[] { "V_FACILITY_CODE" , failitycode  });
                    dtProcedure[i + 2].Rows.Add(new object[] { "V_MAID_NO"       , maidid  });
                    dtProcedure[i + 2].Rows.Add(new object[] { "V_U_EMP_NO"      , BizCommon.Parm.CurrentUserInformation.id  });
                    dtProcedure[i + 2].Rows.Add(new object[] { "V_U_IP"          , BizCommon.Parm.CurrentUserInformation.ip  });
                }

                DataSet dsParm = DataLayer.AddProdedcure(dtProcedure);
                string g = DataLayer.ExecuteSpScalaTransaction(dsParm,"OK", DataLayer.MessageEncoding.Default);
                if (g != "OK")
                {
                    Basic.ShowMessage(3, g);
                    return;
                }


                //프로시져를 호출하여 결과를 리턴 받는다.
                //만약 output 값이 여러개라면 '|' (파이프) 값으로 구분하여 들어온다.
                //Split 함수로 짤라서 사용한다.
                string Result = DataLayer.ExecuteSpScala("PKG_DAAAI06.PR_04", dtparmUpdate, DataLayer.MessageEncoding.Default);

                //프로시져 에러라면 빠져나간다.
                if (Result.Trim() != "OK")
                {
                    Basic.ShowMessage(3, Result);
                    return;
                }

                //수정한 데이터를 조회 를 합니다...
                Selects(false);

                DevExpress.XtraGrid.Columns.GridColumn[] cols;
                object[] obj;
                cols = new GridColumn[] { this.gridView.Columns["MAID_NO"]};
                obj = new object[] { maidid };  

                Cls.Grid.Options.SelectGridRow(this.gridView, cols, obj);

                Basic.ShowMessage(1, "수정 하였습니다.");

            }
            catch (Exception ex)
            {
                Basic.ShowMessage(3, ex.Message);
            }
            finally
            {
                Basic.SetCursor(this, true);
                Basic.LoadParentFunction(this, "", false);
            }
        }
Exemple #48
0
        /// <summary>
        /// Gets the Filter information from the specified filter predicates of the particular column.
        /// </summary>
        /// <param name="filter">The corresponding filterpredicates value.</param>
        /// <param name="visColumn">The corresponding filtered column </param>
        /// <returns>Returns the Filter information from the specified column.</returns>
        protected virtual string GetFilterInfo(FilterPredicate filter, GridColumn visColumn)
        {
            string     filtervalue = (filter.FilterValue != null) ? filter.FilterValue.ToString() : null;
            FilterType filterType  = filter.FilterType;
            string     colname     = "";

            if (filtervalue != null)
            {
                if (visColumn.CellType == "DateTime")
                {
                    filtervalue = this.DateTimeFormatString(visColumn as GridDateTimeColumn, Convert.ToDateTime(filtervalue));
                }
                else if (visColumn.CellType == "Currency")
                {
                    filtervalue = "$" + (String.Format("{0:0.00}", Convert.ToDecimal(filtervalue)));
                }
                else if (visColumn.CellType == "Percent")
                {
                    filtervalue += "%";
                }
            }

            if (visColumn != null)
            {
                colname = (visColumn.HeaderText != "") ? visColumn.HeaderText : (visColumn.MappingName != "" ? visColumn.MappingName : "");
            }
            switch (filterType)
            {
            case FilterType.LessThan:
                return("[" + colname + "]" + " < '" + filtervalue + "'");

            case FilterType.LessThanOrEqual:
                return("[" + colname + "]" + " <= '" + filtervalue + "'");

            case FilterType.Equals:
                if (filtervalue == "")
                {
                    return("[" + colname + "]" + " == Empty");
                }
                if (filtervalue != null)
                {
                    return("[" + colname + "]" + " == '" + filtervalue + "'");
                }
                return("[" + colname + "]" + " = Null");

            case FilterType.NotEquals:
                if (filtervalue == "")
                {
                    return("[" + colname + "]" + " != Empty");
                }
                if (filtervalue != null)
                {
                    return("[" + colname + "]" + " != '" + filtervalue + "'");
                }
                return("[" + colname + "]" + " != Null");

            case FilterType.GreaterThanOrEqual:
                return("[" + colname + "]" + " >= '" + filtervalue + "'");

            case FilterType.GreaterThan:
                return("[" + colname + "]" + " > '" + filtervalue + "'");

            case FilterType.EndsWith:
                return("[" + colname + "]" + " Ends with '" + filtervalue + "'");

            case FilterType.StartsWith:
                return("[" + colname + "]" + " Begins with '" + filtervalue + "'");

            case FilterType.Contains:
                return("[" + colname + "]" + " Contains '" + filtervalue + "'");

            default:
                return("[" + colname + "]" + " '" + filtervalue + "'");
            }
        }
Exemple #49
0
        private void grvTroCapBHXH_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
        {
            try
            {
                string     sSql       = "";
                GridView   view       = sender as GridView;
                GridColumn colTuNgay  = view.Columns["NGHI_TU_NGAY"];
                GridColumn colDenNgay = view.Columns["NGHI_DEN_NGAY"];
                if (view == null)
                {
                    return;
                }
                view.ClearColumnErrors();
                if (e.Column.Name == "colID_CN")
                {
                    sSql = "SELECT MS_CN FROM dbo.CONG_NHAN WHERE ID_CN = " + view.GetRowCellValue(e.RowHandle, view.Columns["ID_CN"]) + "";
                    string s = SqlHelper.ExecuteScalar(Commons.IConnections.CNStr, CommandType.Text, sSql).ToString();
                    view.SetRowCellValue(e.RowHandle, view.Columns["MS_CN"], s);
                }
                if (e.Column.Name == "colID_LDV")
                {
                    sSql = "SELECT PHAN_TRAM_TRO_CAP FROM dbo.LY_DO_VANG WHERE ID_LDV = " + view.GetRowCellValue(e.RowHandle, view.Columns["ID_LDV"]) + "";
                    double d = Convert.ToDouble(SqlHelper.ExecuteScalar(Commons.IConnections.CNStr, CommandType.Text, sSql));
                    view.SetRowCellValue(e.RowHandle, view.Columns["PHAN_TRAM_TRO_CAP"], d);
                }
                if (e.Column.Name == "colNGHI_TU_NGAY" || e.Column.Name == "colNGHI_DEN_NGAY" || e.Column.Name == "colID_CN")
                {
                    DateTime tn   = Convert.ToDateTime(view.GetRowCellValue(e.RowHandle, view.Columns["NGHI_TU_NGAY"]));
                    DateTime dn   = Convert.ToDateTime(view.GetRowCellValue(e.RowHandle, view.Columns["NGHI_DEN_NGAY"]));
                    int      idcn = Convert.ToInt32(view.GetRowCellValue(e.RowHandle, view.Columns["ID_CN"]));
                    TimeSpan time = dn - tn;
                    //kiểm tra từ ngày đến ngày phải không nằm trong khoảng dưới data lẫn trên view
                    if (!kiemtraNgayHopLe(tn, Commons.Modules.ObjSystems.ConvertDatatable(grvTroCapBHXH), Convert.ToInt32(view.GetRowCellValue(e.RowHandle, view.Columns["ID_CN"]))))
                    {
                        view.SetColumnError(colTuNgay, Commons.Modules.ObjLanguages.GetLanguage(this.Name, "TuNgayDaTonTai"));
                        val = false;
                        return;
                    }
                    if (!kiemtraNgayHopLe(dn, Commons.Modules.ObjSystems.ConvertDatatable(grvTroCapBHXH), Convert.ToInt32(view.GetRowCellValue(e.RowHandle, view.Columns["ID_CN"]))))
                    {
                        view.SetColumnError(colDenNgay, Commons.Modules.ObjLanguages.GetLanguage(this.Name, "TuNgayDaTonTai"));
                        val = false;
                        return;
                    }

                    if (time.Days >= 0)
                    {
                        //số giờ lũy kế được tính là trước tháng hiện tại cộng cho thời gian ơ
                        view.SetRowCellValue(e.RowHandle, view.Columns["SO_NGAY_NGHI"], time.Days + 1);
                        sSql = "SELECT dbo.fnGetSoGioLuyKeThangTruoc(" + ThangdateEdit.DateTime.Month + "," + ThangdateEdit.DateTime.Year + "," + view.GetRowCellValue(e.RowHandle, view.Columns["ID_CN"]) + ")";
                        if (e.RowHandle > 0)
                        {
                            view.SetRowCellValue(e.RowHandle, view.Columns["SO_NGAY_NGHI"], time.Days + 1);
                        }
                        else
                        {
                            view.SetRowCellValue(grvTroCapBHXH.RowCount - 2, view.Columns["SO_NGAY_NGHI"], time.Days + 1);
                        }
                        int n;
                        try
                        {
                            n = Convert.ToInt32(SqlHelper.ExecuteScalar(Commons.IConnections.CNStr, CommandType.Text, sSql));
                        }
                        catch (Exception)
                        {
                            n = 0;
                        }
                        //tính số giờ lũy kế hiện tại trên view
                        DataTable dttc = Commons.Modules.ObjSystems.ConvertDatatable(grvTroCapBHXH);
                        for (int i = 0; i < dttc.Rows.Count; i++)
                        {
                            //nếu mà chính là công nhân đó thì gán n
                            if (Convert.ToInt64(view.GetFocusedRowCellValue(view.Columns["ID_CN"])) == Convert.ToInt64(view.GetRowCellValue(i, view.Columns["ID_CN"])))
                            {
                                n += Convert.ToInt32(view.GetRowCellValue(i, view.Columns["SO_NGAY_NGHI"]));
                                view.SetRowCellValue(i, view.Columns["SO_NGAYLK"], n);
                            }
                        }
                    }
                    else
                    {
                        view.SetColumnError(colTuNgay, Commons.Modules.ObjLanguages.GetLanguage(this.Name, "TuNgayKhongLonHonDenNgay"));
                        view.SetColumnError(colDenNgay, Commons.Modules.ObjLanguages.GetLanguage(this.Name, "TuNgayKhongLonHonDenNgay"));
                        val = false;
                        return;
                    }
                    //kiểm tra dòng này là mới hay là cũ   nếu mới thì cho gán các giá trị mặc định vào
                    //Load công thức tính số tiền trợ cấp và lương tính trợ cấp
                    DataTable dt = new DataTable();
                    sSql = "SELECT * from  dbo.funTinhTroCapBHXH(" + idcn + ",'" + Convert.ToDateTime(grvTroCapBHXH.GetFocusedRowCellValue("NGHI_TU_NGAY")).ToString("MM/dd/yyyy") + "')";
                    dt.Load(SqlHelper.ExecuteReader(Commons.IConnections.CNStr, CommandType.Text, sSql));
                    if (e.RowHandle < 0)
                    {
                        view.SetRowCellValue(grvTroCapBHXH.RowCount - 2, view.Columns["LUONG_TINH_TC"], dt.Rows[0]["LUONG_TINH_TC"]);
                        view.SetRowCellValue(grvTroCapBHXH.RowCount - 2, view.Columns["SO_TIEN_TC"], dt.Rows[0]["SO_TIEN_TC"]);
                    }
                    else
                    {
                        view.SetRowCellValue(e.RowHandle, view.Columns["LUONG_TINH_TC"], dt.Rows[0]["LUONG_TINH_TC"]);
                        view.SetRowCellValue(e.RowHandle, view.Columns["SO_TIEN_TC"], dt.Rows[0]["SO_TIEN_TC"]);
                    }
                }
            }
            catch (Exception ex)
            { }
        }
Exemple #50
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            hiddenTabID.Text = Request["TabID"];
            int runProcessID = int.Parse(Request["RunProcess"]);
            FineOffice.Modules.OA_FlowRunProcess model = runProcessBll.GetModel(r => r.ID == runProcessID);

            btnReject.Visible   = !model.IsStart.Value;
            tssReject.Visible   = !model.IsStart.Value;
            btnSendback.Visible = !model.IsStart.Value;
            tssSendback.Visible = !model.IsStart.Value;

            hiddenVersion.Text     = this.ByteToJson(model.Version);
            hiddenRunProcess.Text  = model.ID.ToString();
            txtTransmitAdvice.Text = model.TransmitAdvice;

            lblRemrk.Text      = model.Remark;
            lblCreateTime.Text = string.Format("{0:yyyy-MM-dd mm:ss}", model.WorkCreateTime);
            lblCreator.Text    = model.CreateName;
            lblWorkName.Text   = model.WorkName;
            lblWorkNO.Text     = model.WorkNO;
            hiddenWork.Text    = model.RunID.ToString();

            this.formGrid.PageIndex = 0;
            ChangeTrackingList <EntitySearcher> changeTrackingList = new ChangeTrackingList <EntitySearcher>();
            ViewState["formSql"] = changeTrackingList;
            GridColumn formColumn = formGrid.FindColumn(formGrid.SortColumn);
            formGrid_Bind(changeTrackingList, formColumn.SortField, formGrid.SortDirection);

            this.attachmentGrid.PageIndex = 0;
            ViewState["attachmentSql"]    = changeTrackingList;
            GridColumn attachmentColumn = attachmentGrid.FindColumn(attachmentGrid.SortColumn);
            attachmentGrid_Bind(changeTrackingList, attachmentColumn.SortField, attachmentGrid.SortDirection);

            btnNewForm.OnClientClick    = frmNewFlowForm.GetShowReference("FrmNewFlowForm.aspx?ProcessID=" + model.ProcessID + "&RunProcess=" + model.ID);
            btnModifyForm.OnClientClick = formGrid.GetNoSelectionAlertReference("请选择要操作的表单!");
            btnDownForm.OnClientClick   = formGrid.GetNoSelectionAlertReference("请选择要下载的表单!");
            btnPreview.OnClientClick    = formGrid.GetNoSelectionAlertReference("请选择要预览的表单!");

            btnDownAttachment.OnClientClick = attachmentGrid.GetNoSelectionAlertReference("请选择要下载的附件!");
            btnModifyFileName.OnClientClick = attachmentGrid.GetNoSelectionAlertReference("请选择要操作的附件!");
            btnReject.ConfirmText           = String.Format("你确认要拒绝吗?");

            #region 加载选择下一步的数据

            btnNext.OnClientClick             = this.frmNextProcess.GetShowReference();
            btnCloseNextProcess.OnClientClick = this.frmNextProcess.GetHideReference();

            if (model.Next != null)
            {
                string[] strList = model.Next.Split(',');
                List <FineOffice.Modules.OA_FlowProcess> processList = processBll.GetList(p => strList.Contains(p.ID));
                if (processList.Count > 0)
                {
                    this.processGrid.DataSource = processList;
                    this.processGrid.DataBind();
                    this.processGrid.SelectedRowIndex = 0;
                }
            }
            #endregion

            #region 加载退回的数据
            btnSendback.OnClientClick      = this.frmSendBack.GetShowReference();
            btnCloseSendBack.OnClientClick = this.frmSendBack.GetHideReference();

            List <FineOffice.Modules.OA_FlowRunProcess> runProcessList = runHandlerBll.FlowRunProcessList(new FineOffice.Modules.OA_FlowRun {
                ID = (int)model.RunID
            });
            foreach (FineOffice.Modules.OA_FlowRunProcess temp in runProcessList)
            {
                if (temp.State != 0)
                {
                    radRunProcess.Items.Add(temp.ProcessName, temp.ID.ToString());
                }
            }
            radRunProcess.SelectedIndex = radRunProcess.Items.Count - 1;
            #endregion
        }
        if (Request.Form["__EVENTARGUMENT"] == "refreshRunData")
        {
            ChangeTrackingList <EntitySearcher> changeTrackingList = ViewState["formSql"] as ChangeTrackingList <EntitySearcher>;
            GridColumn column = formGrid.FindColumn(formGrid.SortColumn);
            formGrid_Bind(changeTrackingList, column.SortField, formGrid.SortDirection);
        }
        if (Request.Form["__EVENTARGUMENT"] == "refresh_attachment")
        {
            ChangeTrackingList <EntitySearcher> changeTrackingList = ViewState["attachmentSql"] as ChangeTrackingList <EntitySearcher>;
            GridColumn column = attachmentGrid.FindColumn(attachmentGrid.SortColumn);
            attachmentGrid_Bind(changeTrackingList, column.SortField, attachmentGrid.SortDirection);
        }
        if (Request.Form["__EVENTARGUMENT"] == "transmitClose")
        {
            PageContext.RegisterStartupScript("saveRunProcess();");
        }
    }
Exemple #51
0
        protected override Control OnDefineLayout()
        {
            _layout      = new TableLayout(2, 2);
            _pouchHeader = new Label();

            var actionBar = new TableLayout(2, 1)
            {
                Spacing = new Size(5, 0),
                Padding = new Padding(0, 0, 0, 5)
            };

            actionBar.Add(_pouchHeader, 0, 0, true, false);
            actionBar.Add(null, 1, 0, false, false);

            // Events Grid
            // visibility column; will show an image for protected or public.
            var visCol = new GridColumn
            {
                Sortable   = false,
                HeaderText = "Visibility",
                Editable   = false,
                DataCell   = new TextBoxCell("Visibility")
            };

            // show event name
            var nameCol = new GridColumn
            {
                Sortable   = false,
                HeaderText = "Name",
                Editable   = false,
                DataCell   = new TextBoxCell {
                    Binding = Binding.Property((IToolboxEventModel m) => m.DisplayName)
                }
            };

            // event handler name
            var handlerCol = new GridColumn
            {
                Sortable   = false,
                HeaderText = "Handler",
                Width      = 120,
                Editable   = false,
                DataCell   = new TextBoxCell {
                    Binding = Binding.Property((IToolboxEventModel m) => m.EventHandlerName)
                }
            };

            // edit event name
            var btnCol = new GridColumn
            {
                Sortable   = false,
                HeaderText = "Edit Event",
                Editable   = false,
                DataCell   = new ButtonCell()
            };

            // menu
            var editCmd    = new Command(OnEditItem);
            var compileCmd = new Command(OnAttachEvent);

            var editHandler = new ButtonMenuItem(editCmd)
            {
                Text    = "Edit Event Handler",
                Enabled = false
            };

            var attachItem = new ButtonMenuItem(compileCmd)
            {
                Text    = "Attach Event Handler",
                Enabled = false
            };

            var ctxMenu = new ContextMenu(editHandler, attachItem);

            // grid
            _eventsGrid = new GridView
            {
                Columns     = { visCol, nameCol, handlerCol, btnCol },
                ContextMenu = ctxMenu,
                DataStore   = _filtered,
                RowHeight   = AppStyles.GridRowHeight,
            };

            _layout.Add(actionBar, 0, 0, false, false);
            _layout.Add(_eventsGrid, 0, 1, true, true);

            _layout.Shown += (sender, args) =>
            {
                ToolboxApp.AppEvents.RefreshWidget(PouchTypes.Events);
            };

            return(_layout);
        }
 protected override bool ColumnIsValue(GridColumn column)
 {
     return(_colRelativeExpression.XtraColumn == column);
 }
Exemple #53
0
        /// <summary>
        /// Value tentatively changed
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>

        private void FieldGridView_CellValueChanging(object sender, CellValueChangedEventArgs e)
        {
            int ri = e.RowHandle;

            if (ri < 0)
            {
                return;
            }
            DataRow dr = FieldGridDataTable.Rows[ri];

            GridColumn gc = e.Column;

            if (gc == null)
            {
                return;
            }
            int gci = gc.AbsoluteIndex;

            PivotGridFieldMx f    = PivotGrid.Fields[ri] as PivotGridFieldMx;
            ResultsField     rfld = f.ResultsField as ResultsField;

            Mobius.Data.QueryColumn qc = rfld.QueryColumn;
            MetaColumn mc = qc.MetaColumn;

            if (gc.FieldName == "FieldNameCol")
            {
                return;                 // wait til move out of cell
            }

            else if (gc.FieldName == "AggRoleCol")
            {
                //e=e;
                //object o = e.Value;
                //DataRow dr2 = FieldGridDataTable.Rows[e.RowHandle];
                //object vo = dr2["AggRoleCol"];
                //FieldGridDataTable

                f.SyncDxAreaToMxRole();                 // sync Dx area
                PivotGrid.RefreshData();                // refresh the PivotGrid to show new agg type results

                //dr["AggRoleCol"] = f.Aggregation.TypeLabel;
                return;                 // throw new NotImplementedException();

                //string txt = e.Value.ToString();
                //if (Lex.IsNullOrEmpty(txt) || Lex.Eq(txt, "None"))
                //{
                //	f.Visible = false;

                //	dr["SummaryTypeCol"] = "";
                //	//dr["HeaderBinningCol"] = "";
                //}
                //else
                //{
                //	f.Area = (PivotArea)Enum.Parse(typeof(PivotArea), txt);
                //	f.Visible = true;

                //	dr["SummaryTypeCol"] = SummaryTypeLabel(f);
                //	//dr["HeaderBinningCol"] = GroupingTypeLabel(f);
                //}

                //PivotGrid.SetFilterHeaderVisibility();
            }

            else if (gc.FieldName == "AggTypeCol")
            {
                return;
            }

            //else if (gc.FieldName == "HeaderBinningCol")
            //{
            //	return;
            //}

            else if (gc.FieldName == "SourceColumnCol" || gc.FieldName == "SourceTableCol")
            {
                return;
            }

            else
            {
                return;              // something else
            }
        }
Exemple #54
0
        /// <summary>
        /// 수정함수
        /// </summary>
        private void Updates()
        {
            try
            {
                ///TDDO:[템플릿]수정

                //유효성 검사후 실행합니다.
                if (!ISCheckData(JobStyle.UPDATE))
                {
                    return;
                }
                Basic.SetCursor(this, false);
                Basic.LoadParentFunction(this, "저장 중 입니다..", true);

                string reamtNo        = Convert.ToString(gridView.GetRowCellValue(gridView.FocusedRowHandle, "REAMT_NO"));
                string rsamtInfo      = Convert.ToString(gridView.GetRowCellValue(gridView.FocusedRowHandle, "RSAMT_INFO"));
                string bizcode        = Parm.CurrentUserInformation.BizInfo.BizCode;
                string rsvAmt         = Basic.MaskReplace(this.txtRsvAmt.Text.Trim());
                string penaltyAmt     = Basic.MaskReplace(this.txtPenaltyAmt.Text.Trim());
                string appDate        = Basic.MaskReplace(this.dtpAppDate.Text.Trim());
                string acceptYn       = this.chkAcceptYn.Checked ? "Y" : "N";
                string acceptDate     = Basic.MaskReplace(this.dtpAcceptDate.Text.Trim());
                string penaltyEmpNo   = this.txtPenaltyEmpNo.Text.Trim();
                string penaltyEmpRmrk = this.mmoPenaltyRmrk.Text.Trim();
                string bankCode       = this.lupBankCode.EditValue.ToString().Trim();
                string bankNo         = this.txtBankNo.Text.Trim();
                string depositor      = this.txtDepositor.Text.Trim();
                string refundAmt      = Basic.MaskReplace(this.txtRefundAmt.Text.Trim());
                string refundDate     = Basic.MaskReplace(this.dtpRefundDate.Text.Trim());
                string refundYn       = this.chkRefundYn.Checked ? "Y" : "N";
                string refundEmpNo    = this.txtRefundEmpNo.Text.Trim();
                string refundRmrk     = this.mmoRefundRmrk.Text.Trim();
                string rsvNo          = this.txtInsRsvNo.Text.Trim();
                string empNo          = Parm.CurrentUserInformation.id;
                string ip             = Parm.CurrentUserInformation.ip;


                //입력함수를 구현합니다.
                DataTable dtparmUpdate = DataLayer.GetDataTableParameter(DataLayer.DatatableStyle.Parameter);
                dtparmUpdate.Rows.Add(new object[] { "V_REAMT_NO", reamtNo });
                dtparmUpdate.Rows.Add(new object[] { "V_BIZ_CODE", bizcode });
                dtparmUpdate.Rows.Add(new object[] { "V_RSV_AMT", rsvAmt });
                dtparmUpdate.Rows.Add(new object[] { "V_PENALTY_AMT", penaltyAmt });
                dtparmUpdate.Rows.Add(new object[] { "V_APP_DATE", appDate });
                dtparmUpdate.Rows.Add(new object[] { "V_ACCEPT_YN", acceptYn });
                dtparmUpdate.Rows.Add(new object[] { "V_ACCEPT_DATE", acceptDate });
                dtparmUpdate.Rows.Add(new object[] { "V_PENALTY_EMP_NO", penaltyEmpNo });
                dtparmUpdate.Rows.Add(new object[] { "V_PENALTY_RMRK", penaltyEmpRmrk });
                dtparmUpdate.Rows.Add(new object[] { "V_BANK_CODE", bankCode });
                dtparmUpdate.Rows.Add(new object[] { "V_BANK_NO", bankNo });
                dtparmUpdate.Rows.Add(new object[] { "V_DEPOSITOR", depositor });
                dtparmUpdate.Rows.Add(new object[] { "V_REFUND_AMT", refundAmt });
                dtparmUpdate.Rows.Add(new object[] { "V_REFUND_DATE", refundDate });
                dtparmUpdate.Rows.Add(new object[] { "V_REFUND_YN", refundYn });
                dtparmUpdate.Rows.Add(new object[] { "V_REFUND_EMP_NO", refundEmpNo });
                dtparmUpdate.Rows.Add(new object[] { "V_REFUND_RMRK", refundRmrk });
                dtparmUpdate.Rows.Add(new object[] { "V_RSV_NO", rsvNo });
                dtparmUpdate.Rows.Add(new object[] { "V_RSAMT_INFO", rsamtInfo });
                dtparmUpdate.Rows.Add(new object[] { "V_EMP_NO", empNo });
                dtparmUpdate.Rows.Add(new object[] { "V_IP", ip });

                //프로시져를 호출하여 결과를 리턴 받는다.
                //만약 output 값이 여러개라면 '|' (파이프) 값으로 구분하여 들어온다.
                //Split 함수로 짤라서 사용한다.
                string Result = DataLayer.ExecuteSpScala("PKG_CDAAI02.PR_11", dtparmUpdate, DataLayer.MessageEncoding.Default);

                string[] arry = Result.Split('|');

                //프로시져 에러라면 빠져나간다.
                if (arry[1] != "OK")
                {
                    Basic.ShowMessage(3, arry[1]);
                    return;
                }

                string rsvno = arry[0];

                //입력한 데이터를 조회 를 합니다...
                Selects(false);

                DevExpress.XtraGrid.Columns.GridColumn[] cols1 = new GridColumn[] { gridView.Columns["RSV_NO"] };

                int i1 = Cls.Grid.Options.LocateRowByMultipleValues(gridView,
                                                                    cols1,
                                                                    new object[] { rsvno },
                                                                    0);

                if (i1 >= 0)
                {
                    gridView.FocusedRowHandle = i1;
                }



                Basic.ShowMessage(1, "저장 하였습니다.");
            }
            catch (Exception ex)
            {
                Basic.ShowMessage(3, ex.Message);
            }
            finally
            {
                Basic.SetCursor(this, true);
                Basic.LoadParentFunction(this, "", false);
            }
        }
Exemple #55
0
        public void GridColumn_MemberExpression_IsFilterableIsNull()
        {
            GridColumn <GridModel, Int32> column = new GridColumn <GridModel, Int32>(grid, model => model.Sum);

            Assert.Null(column.IsFilterable);
        }
 private void InitializeComponent()
 {
     this.components         = new System.ComponentModel.Container();
     this.simpleButton1      = new DevExpress.XtraEditors.SimpleButton();
     this.btnCancelar        = new DevExpress.XtraEditors.SimpleButton();
     this.btnAnadir          = new DevExpress.XtraEditors.SimpleButton();
     this.alertControl1      = new DevExpress.XtraBars.Alerter.AlertControl(this.components);
     this.txtTotal           = new DevExpress.XtraEditors.TextEdit();
     this.labelControl4      = new DevExpress.XtraEditors.LabelControl();
     this.txtArticulos       = new DevExpress.XtraEditors.TextEdit();
     this.labelControl5      = new DevExpress.XtraEditors.LabelControl();
     this.labelControl12     = new DevExpress.XtraEditors.LabelControl();
     this.txtCostoBase       = new DevExpress.XtraEditors.TextEdit();
     this.txtNombre          = new DevExpress.XtraEditors.TextEdit();
     this.labelControl13     = new DevExpress.XtraEditors.LabelControl();
     this.xtraTabControl1    = new DevExpress.XtraTab.XtraTabControl();
     this.xtraTabPage2       = new DevExpress.XtraTab.XtraTabPage();
     this.btnBorrar          = new DevExpress.XtraEditors.SimpleButton();
     this.btnAgregarArticulo = new DevExpress.XtraEditors.SimpleButton();
     this.gridArticulos      = new DevExpress.XtraGrid.GridControl();
     this.viewArticulo       = new DevExpress.XtraGrid.Views.Grid.GridView();
     this.gridColumn2        = new DevExpress.XtraGrid.Columns.GridColumn();
     this.gridColumn7        = new DevExpress.XtraGrid.Columns.GridColumn();
     this.gridColumn1        = new DevExpress.XtraGrid.Columns.GridColumn();
     this.gridColumn3        = new DevExpress.XtraGrid.Columns.GridColumn();
     this.gridColumn4        = new DevExpress.XtraGrid.Columns.GridColumn();
     this.gridView3          = new DevExpress.XtraGrid.Views.Grid.GridView();
     ((System.ComponentModel.ISupportInitialize)(this.txtTotal.Properties)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.txtArticulos.Properties)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.txtCostoBase.Properties)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.txtNombre.Properties)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.xtraTabControl1)).BeginInit();
     this.xtraTabControl1.SuspendLayout();
     this.xtraTabPage2.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.gridArticulos)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.viewArticulo)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.gridView3)).BeginInit();
     this.SuspendLayout();
     //
     // simpleButton1
     //
     this.simpleButton1.Anchor                            = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     this.simpleButton1.Appearance.Font                   = new System.Drawing.Font("Calibri", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.simpleButton1.Appearance.Options.UseFont        = true;
     this.simpleButton1.Appearance.Options.UseTextOptions = true;
     this.simpleButton1.Appearance.TextOptions.VAlignment = DevExpress.Utils.VertAlignment.Center;
     this.simpleButton1.ImageLocation                     = DevExpress.XtraEditors.ImageLocation.MiddleRight;
     this.simpleButton1.Location                          = new System.Drawing.Point(1194, 49);
     this.simpleButton1.Name            = "simpleButton1";
     this.simpleButton1.Size            = new System.Drawing.Size(24, 24);
     this.simpleButton1.TabIndex        = 26;
     this.simpleButton1.Text            = "+";
     this.simpleButton1.ToolTip         = "Crea una categoria para el articulo relacionado.";
     this.simpleButton1.ToolTipIconType = DevExpress.Utils.ToolTipIconType.Information;
     this.simpleButton1.ToolTipTitle    = "Nueva categoria";
     //
     // btnCancelar
     //
     this.btnCancelar.Anchor                            = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     this.btnCancelar.Appearance.Font                   = new System.Drawing.Font("Calibri", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.btnCancelar.Appearance.Options.UseFont        = true;
     this.btnCancelar.Appearance.Options.UseTextOptions = true;
     this.btnCancelar.Appearance.TextOptions.VAlignment = DevExpress.Utils.VertAlignment.Center;
     this.btnCancelar.DialogResult                      = System.Windows.Forms.DialogResult.Cancel;
     this.btnCancelar.ImageLocation                     = DevExpress.XtraEditors.ImageLocation.MiddleRight;
     this.btnCancelar.Location                          = new System.Drawing.Point(829, 592);
     this.btnCancelar.Name            = "btnCancelar";
     this.btnCancelar.Size            = new System.Drawing.Size(101, 30);
     this.btnCancelar.TabIndex        = 32;
     this.btnCancelar.Text            = "Cancelar";
     this.btnCancelar.ToolTip         = "Le permite al usuario añadir un nuevo articulo al Inventario.";
     this.btnCancelar.ToolTipIconType = DevExpress.Utils.ToolTipIconType.Information;
     this.btnCancelar.ToolTipTitle    = "Agregar";
     //
     // btnAnadir
     //
     this.btnAnadir.Anchor                            = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     this.btnAnadir.Appearance.Font                   = new System.Drawing.Font("Calibri", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.btnAnadir.Appearance.Options.UseFont        = true;
     this.btnAnadir.Appearance.Options.UseTextOptions = true;
     this.btnAnadir.Appearance.TextOptions.VAlignment = DevExpress.Utils.VertAlignment.Center;
     this.btnAnadir.ImageLocation                     = DevExpress.XtraEditors.ImageLocation.MiddleRight;
     this.btnAnadir.Location                          = new System.Drawing.Point(935, 592);
     this.btnAnadir.Name            = "btnAnadir";
     this.btnAnadir.Size            = new System.Drawing.Size(101, 30);
     this.btnAnadir.TabIndex        = 31;
     this.btnAnadir.Text            = " Aceptar";
     this.btnAnadir.ToolTip         = "Le permite al usuario añadir un nuevo articulo al Inventario.";
     this.btnAnadir.ToolTipIconType = DevExpress.Utils.ToolTipIconType.Information;
     this.btnAnadir.ToolTipTitle    = "Agregar";
     this.btnAnadir.Click          += new System.EventHandler(this.btnAnadir_Click);
     //
     // txtTotal
     //
     this.txtTotal.EditValue = "0";
     this.txtTotal.Location  = new System.Drawing.Point(361, 116);
     this.txtTotal.Name      = "txtTotal";
     this.txtTotal.Properties.Appearance.Font                   = new System.Drawing.Font("Calibri", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.txtTotal.Properties.Appearance.Options.UseFont        = true;
     this.txtTotal.Properties.Appearance.Options.UseTextOptions = true;
     this.txtTotal.Properties.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
     this.txtTotal.Properties.Mask.EditMask = "c";
     this.txtTotal.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric;
     this.txtTotal.Properties.Mask.UseMaskAsDisplayFormat = true;
     this.txtTotal.Properties.ReadOnly = true;
     this.txtTotal.Size     = new System.Drawing.Size(137, 24);
     this.txtTotal.TabIndex = 89;
     //
     // labelControl4
     //
     this.labelControl4.Appearance.Font = new System.Drawing.Font("Calibri", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.labelControl4.Location        = new System.Drawing.Point(361, 92);
     this.labelControl4.Name            = "labelControl4";
     this.labelControl4.Size            = new System.Drawing.Size(71, 18);
     this.labelControl4.TabIndex        = 90;
     this.labelControl4.Text            = "Costo neto:";
     //
     // txtArticulos
     //
     this.txtArticulos.EditValue = "0";
     this.txtArticulos.Location  = new System.Drawing.Point(199, 116);
     this.txtArticulos.Name      = "txtArticulos";
     this.txtArticulos.Properties.Appearance.Font                   = new System.Drawing.Font("Calibri", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.txtArticulos.Properties.Appearance.Options.UseFont        = true;
     this.txtArticulos.Properties.Appearance.Options.UseTextOptions = true;
     this.txtArticulos.Properties.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
     this.txtArticulos.Properties.Mask.EditMask = "c";
     this.txtArticulos.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric;
     this.txtArticulos.Properties.Mask.UseMaskAsDisplayFormat = true;
     this.txtArticulos.Properties.ReadOnly = true;
     this.txtArticulos.Size     = new System.Drawing.Size(137, 24);
     this.txtArticulos.TabIndex = 87;
     //
     // labelControl5
     //
     this.labelControl5.Appearance.Font = new System.Drawing.Font("Calibri", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.labelControl5.Location        = new System.Drawing.Point(199, 92);
     this.labelControl5.Name            = "labelControl5";
     this.labelControl5.Size            = new System.Drawing.Size(95, 18);
     this.labelControl5.TabIndex        = 88;
     this.labelControl5.Text            = "Costo articulos:";
     //
     // labelControl12
     //
     this.labelControl12.Appearance.Font = new System.Drawing.Font("Calibri", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.labelControl12.Location        = new System.Drawing.Point(37, 35);
     this.labelControl12.Name            = "labelControl12";
     this.labelControl12.Size            = new System.Drawing.Size(129, 18);
     this.labelControl12.TabIndex        = 85;
     this.labelControl12.Text            = "Nombre del servicio:";
     //
     // txtCostoBase
     //
     this.txtCostoBase.EditValue = "0";
     this.txtCostoBase.Location  = new System.Drawing.Point(38, 116);
     this.txtCostoBase.Name      = "txtCostoBase";
     this.txtCostoBase.Properties.Appearance.Font                   = new System.Drawing.Font("Calibri", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.txtCostoBase.Properties.Appearance.Options.UseFont        = true;
     this.txtCostoBase.Properties.Appearance.Options.UseTextOptions = true;
     this.txtCostoBase.Properties.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
     this.txtCostoBase.Properties.Mask.EditMask = "c";
     this.txtCostoBase.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric;
     this.txtCostoBase.Properties.Mask.UseMaskAsDisplayFormat = true;
     this.txtCostoBase.Size              = new System.Drawing.Size(137, 24);
     this.txtCostoBase.TabIndex          = 82;
     this.txtCostoBase.EditValueChanged += new System.EventHandler(this.txtCostoBase_EditValueChanged);
     //
     // txtNombre
     //
     this.txtNombre.Location = new System.Drawing.Point(37, 59);
     this.txtNombre.Name     = "txtNombre";
     this.txtNombre.Properties.Appearance.Font            = new System.Drawing.Font("Calibri", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.txtNombre.Properties.Appearance.Options.UseFont = true;
     this.txtNombre.Size     = new System.Drawing.Size(305, 24);
     this.txtNombre.TabIndex = 83;
     //
     // labelControl13
     //
     this.labelControl13.Appearance.Font = new System.Drawing.Font("Calibri", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.labelControl13.Location        = new System.Drawing.Point(38, 92);
     this.labelControl13.Name            = "labelControl13";
     this.labelControl13.Size            = new System.Drawing.Size(104, 18);
     this.labelControl13.TabIndex        = 84;
     this.labelControl13.Text            = "Costo base (mo):";
     //
     // xtraTabControl1
     //
     this.xtraTabControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                          | System.Windows.Forms.AnchorStyles.Left)
                                                                         | System.Windows.Forms.AnchorStyles.Right)));
     this.xtraTabControl1.Location        = new System.Drawing.Point(37, 159);
     this.xtraTabControl1.Name            = "xtraTabControl1";
     this.xtraTabControl1.SelectedTabPage = this.xtraTabPage2;
     this.xtraTabControl1.Size            = new System.Drawing.Size(999, 416);
     this.xtraTabControl1.TabIndex        = 91;
     this.xtraTabControl1.TabPages.AddRange(new DevExpress.XtraTab.XtraTabPage[] {
         this.xtraTabPage2
     });
     //
     // xtraTabPage2
     //
     this.xtraTabPage2.Controls.Add(this.btnBorrar);
     this.xtraTabPage2.Controls.Add(this.btnAgregarArticulo);
     this.xtraTabPage2.Controls.Add(this.gridArticulos);
     this.xtraTabPage2.Name = "xtraTabPage2";
     this.xtraTabPage2.Size = new System.Drawing.Size(993, 388);
     this.xtraTabPage2.Text = "Articulos necesarios";
     //
     // btnBorrar
     //
     this.btnBorrar.Appearance.Font                   = new System.Drawing.Font("Calibri", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.btnBorrar.Appearance.Options.UseFont        = true;
     this.btnBorrar.Appearance.Options.UseTextOptions = true;
     this.btnBorrar.Appearance.TextOptions.VAlignment = DevExpress.Utils.VertAlignment.Center;
     this.btnBorrar.ImageToTextAlignment              = DevExpress.XtraEditors.ImageAlignToText.RightCenter;
     this.btnBorrar.Location        = new System.Drawing.Point(104, 16);
     this.btnBorrar.Name            = "btnBorrar";
     this.btnBorrar.Size            = new System.Drawing.Size(77, 24);
     this.btnBorrar.TabIndex        = 53;
     this.btnBorrar.Text            = "Borrar";
     this.btnBorrar.ToolTip         = "Le permite al usuario añadir un nuevo articulo al Inventario.";
     this.btnBorrar.ToolTipIconType = DevExpress.Utils.ToolTipIconType.Information;
     this.btnBorrar.ToolTipTitle    = "Nuevo";
     this.btnBorrar.Click          += new System.EventHandler(this.btnBorrar_Click);
     //
     // btnAgregarArticulo
     //
     this.btnAgregarArticulo.Appearance.Font                   = new System.Drawing.Font("Calibri", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.btnAgregarArticulo.Appearance.Options.UseFont        = true;
     this.btnAgregarArticulo.Appearance.Options.UseTextOptions = true;
     this.btnAgregarArticulo.Appearance.TextOptions.VAlignment = DevExpress.Utils.VertAlignment.Center;
     this.btnAgregarArticulo.ImageToTextAlignment              = DevExpress.XtraEditors.ImageAlignToText.RightCenter;
     this.btnAgregarArticulo.Location        = new System.Drawing.Point(21, 16);
     this.btnAgregarArticulo.Name            = "btnAgregarArticulo";
     this.btnAgregarArticulo.Size            = new System.Drawing.Size(77, 24);
     this.btnAgregarArticulo.TabIndex        = 52;
     this.btnAgregarArticulo.Text            = "Agregar";
     this.btnAgregarArticulo.ToolTip         = "Le permite al usuario añadir un nuevo articulo al Inventario.";
     this.btnAgregarArticulo.ToolTipIconType = DevExpress.Utils.ToolTipIconType.Information;
     this.btnAgregarArticulo.ToolTipTitle    = "Nuevo";
     this.btnAgregarArticulo.Click          += new System.EventHandler(this.simpleButton3_Click);
     //
     // gridArticulos
     //
     this.gridArticulos.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                        | System.Windows.Forms.AnchorStyles.Left)
                                                                       | System.Windows.Forms.AnchorStyles.Right)));
     this.gridArticulos.Location = new System.Drawing.Point(21, 46);
     this.gridArticulos.MainView = this.viewArticulo;
     this.gridArticulos.Name     = "gridArticulos";
     this.gridArticulos.Size     = new System.Drawing.Size(954, 327);
     this.gridArticulos.TabIndex = 44;
     this.gridArticulos.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
         this.viewArticulo,
         this.gridView3
     });
     this.gridArticulos.ProcessGridKey += new System.Windows.Forms.KeyEventHandler(this.gridArticulos_ProcessGridKey_1);
     //
     // viewArticulo
     //
     this.viewArticulo.Appearance.HeaderPanel.Font            = new System.Drawing.Font("Segoe UI Semibold", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.viewArticulo.Appearance.HeaderPanel.Options.UseFont = true;
     this.viewArticulo.Appearance.Row.Font            = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.viewArticulo.Appearance.Row.Options.UseFont = true;
     this.viewArticulo.ColumnPanelRowHeight           = 30;
     this.viewArticulo.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
         this.gridColumn2,
         this.gridColumn7,
         this.gridColumn1,
         this.gridColumn3,
         this.gridColumn4
     });
     this.viewArticulo.GridControl = this.gridArticulos;
     this.viewArticulo.Name        = "viewArticulo";
     this.viewArticulo.OptionsBehavior.Editable = false;
     this.viewArticulo.OptionsSelection.EnableAppearanceFocusedCell = false;
     this.viewArticulo.OptionsView.ShowGroupPanel = false;
     this.viewArticulo.RowHeight = 30;
     //
     // gridColumn2
     //
     this.gridColumn2.AppearanceCell.Options.UseTextOptions   = true;
     this.gridColumn2.AppearanceCell.TextOptions.HAlignment   = DevExpress.Utils.HorzAlignment.Center;
     this.gridColumn2.AppearanceHeader.Options.UseTextOptions = true;
     this.gridColumn2.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
     this.gridColumn2.Caption   = "ID";
     this.gridColumn2.FieldName = "id_articulo";
     this.gridColumn2.MaxWidth  = 300;
     this.gridColumn2.Name      = "gridColumn2";
     this.gridColumn2.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
     this.gridColumn2.Visible      = true;
     this.gridColumn2.VisibleIndex = 0;
     this.gridColumn2.Width        = 62;
     //
     // gridColumn7
     //
     this.gridColumn7.AppearanceCell.Options.UseTextOptions   = true;
     this.gridColumn7.AppearanceCell.TextOptions.HAlignment   = DevExpress.Utils.HorzAlignment.Center;
     this.gridColumn7.AppearanceHeader.Options.UseTextOptions = true;
     this.gridColumn7.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
     this.gridColumn7.Caption   = "Cantidad";
     this.gridColumn7.FieldName = "cantidad";
     this.gridColumn7.Name      = "gridColumn7";
     this.gridColumn7.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.True;
     this.gridColumn7.Visible      = true;
     this.gridColumn7.VisibleIndex = 2;
     this.gridColumn7.Width        = 74;
     //
     // gridColumn1
     //
     this.gridColumn1.Caption      = "Nombre";
     this.gridColumn1.FieldName    = "nombre";
     this.gridColumn1.Name         = "gridColumn1";
     this.gridColumn1.Visible      = true;
     this.gridColumn1.VisibleIndex = 1;
     this.gridColumn1.Width        = 608;
     //
     // gridColumn3
     //
     this.gridColumn3.AppearanceCell.Options.UseTextOptions   = true;
     this.gridColumn3.AppearanceCell.TextOptions.HAlignment   = DevExpress.Utils.HorzAlignment.Center;
     this.gridColumn3.AppearanceHeader.Options.UseTextOptions = true;
     this.gridColumn3.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
     this.gridColumn3.Caption = "Precio unitario";
     this.gridColumn3.DisplayFormat.FormatString = "c";
     this.gridColumn3.DisplayFormat.FormatType   = DevExpress.Utils.FormatType.Numeric;
     this.gridColumn3.FieldName    = "precio_unitario";
     this.gridColumn3.Name         = "gridColumn3";
     this.gridColumn3.Visible      = true;
     this.gridColumn3.VisibleIndex = 3;
     this.gridColumn3.Width        = 94;
     //
     // gridColumn4
     //
     this.gridColumn4.AppearanceCell.Options.UseTextOptions   = true;
     this.gridColumn4.AppearanceCell.TextOptions.HAlignment   = DevExpress.Utils.HorzAlignment.Center;
     this.gridColumn4.AppearanceHeader.Options.UseTextOptions = true;
     this.gridColumn4.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
     this.gridColumn4.Caption = "Total";
     this.gridColumn4.DisplayFormat.FormatString = "c";
     this.gridColumn4.DisplayFormat.FormatType   = DevExpress.Utils.FormatType.Numeric;
     this.gridColumn4.FieldName    = "total";
     this.gridColumn4.Name         = "gridColumn4";
     this.gridColumn4.Visible      = true;
     this.gridColumn4.VisibleIndex = 4;
     this.gridColumn4.Width        = 98;
     //
     // gridView3
     //
     this.gridView3.GridControl = this.gridArticulos;
     this.gridView3.Name        = "gridView3";
     //
     // FrmRegServicio
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
     this.ClientSize          = new System.Drawing.Size(1060, 647);
     this.Controls.Add(this.xtraTabControl1);
     this.Controls.Add(this.txtTotal);
     this.Controls.Add(this.labelControl4);
     this.Controls.Add(this.btnCancelar);
     this.Controls.Add(this.txtArticulos);
     this.Controls.Add(this.btnAnadir);
     this.Controls.Add(this.labelControl5);
     this.Controls.Add(this.labelControl12);
     this.Controls.Add(this.txtCostoBase);
     this.Controls.Add(this.txtNombre);
     this.Controls.Add(this.labelControl13);
     this.Controls.Add(this.simpleButton1);
     this.Name  = "FrmRegServicio";
     this.Text  = "Servicio";
     this.Load += new System.EventHandler(this.frmNuevaActividad_Load);
     ((System.ComponentModel.ISupportInitialize)(this.txtTotal.Properties)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.txtArticulos.Properties)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.txtCostoBase.Properties)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.txtNombre.Properties)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.xtraTabControl1)).EndInit();
     this.xtraTabControl1.ResumeLayout(false);
     this.xtraTabPage2.ResumeLayout(false);
     ((System.ComponentModel.ISupportInitialize)(this.gridArticulos)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.viewArticulo)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.gridView3)).EndInit();
     this.ResumeLayout(false);
     this.PerformLayout();
 }
Exemple #57
0
        public void GridColumn_NotMemberExpression_SetsNullTitle()
        {
            column = new GridColumn <GridModel, Object>(grid, model => model.ToString());

            Assert.Null(column.Title.ToString());
        }
Exemple #58
0
        public void Init()
        {
            int w = (int)(sf * 640);
            int h = (int)(sf * 480);

            var center = Screen.PrimaryScreen.WorkingArea.Center;

            center.X -= w / 2;
            center.Y -= h / 2;

            Location = new Point(center);

            ClientSize = new Size(w, h);

            Maximizable = false;

            Minimizable = false;

            Resizable = false;

            ShowInTaskbar = false;

            AddComponentInfo();
            AddComponentInfoN();

            string imgprefix = "DWSIM.UI.Forms.Resources.Icons.";

            Title = "AboutDWSIM".Localize();

            Icon = Eto.Drawing.Icon.FromResource(imgprefix + "DWSIM_ico.ico");

            var layout = new PixelLayout();

            string vtext = "Version".Localize() + " " + Assembly.GetExecutingAssembly().GetName().Version.Major.ToString() +
                           "." + Assembly.GetExecutingAssembly().GetName().Version.Minor.ToString() +
                           "." + Assembly.GetExecutingAssembly().GetName().Version.Build.ToString();

            string crtext = Shared.AssemblyCopyright;

            layout.Add(new ImageView {
                Size = new Size((int)(sf * 100), (int)(sf * 100)), Image = new Bitmap(Eto.Drawing.Bitmap.FromResource(imgprefix + "DWSIM_ico.png"))
            }, 0, 0);
            layout.Add(new Label {
                Text = "DWSIM Simulator (Cross-Platform User Interface)", TextAlignment = TextAlignment.Left, Font = SystemFonts.Bold(null, FontDecoration.None)
            }, (int)(sf * 110), 0);
            layout.Add(new Label {
                Text = vtext, TextAlignment = TextAlignment.Left
            }, (int)(sf * 110), (int)(sf * 20));
            layout.Add(new Label {
                Text = crtext, TextAlignment = TextAlignment.Left
            }, (int)(sf * 110), (int)(sf * 40));

            string osinfo = "", clrinfo = "", meminfo = "";

            if (Application.Instance.Platform.IsMac)
            {
                var osversion = Environment.OSVersion.Version.ToString();
                switch (osversion)
                {
                case "11.0.0.0": osinfo = "Mac OS X Lion (v10.7.0)"; break;

                case "11.4.2.0": osinfo = "Mac OS X Lion (v10.7.5)"; break;

                case "12.0.0.0": osinfo = "OS X Mountain Lion (v10.8.0)"; break;

                case "13.0.0.0": osinfo = "OS X Mavericks (v10.9.0)"; break;

                case "13.4.0.0": osinfo = "OS X Mavericks (v10.9.5)"; break;

                case "14.0.0.0": osinfo = "OS X Yosemite (v10.10.0)"; break;

                case "14.5.0.0": osinfo = "OS X Yosemite (v10.10.5)"; break;

                case "15.0.0.0": osinfo = "OS X El Captain (v10.11.0)"; break;

                case "15.6.0.0": osinfo = "OS X El Captain (v10.11.6)"; break;

                case "16.0.0.0": osinfo = "macOS Sierra (v10.12.0)"; break;

                case "16.1.0.0": osinfo = "macOS Sierra (v10.12.1)"; break;

                case "16.3.0.0": osinfo = "macOS Sierra (v10.12.2)"; break;

                case "16.4.5.0": osinfo = "macOS Sierra (v10.12.3)"; break;

                case "16.5.0.0": osinfo = "macOS Sierra (v10.12.4)"; break;

                case "16.6.0.0": osinfo = "macOS Sierra (v10.12.5)"; break;

                case "16.7.0.0": osinfo = "macOS Sierra (v10.12.6)"; break;

                case "17.0.0.0": osinfo = "macOS High Sierra (v10.13.0)"; break;

                case "17.4.0.0": osinfo = "macOS High Sierra (v10.13.3)"; break;

                case "18.0.0.0": osinfo = "macOS Mojave (v10.14.0)"; break;

                case "18.2.0.0": osinfo = "macOS Mojave (v10.14.1-3)"; break;

                case "18.5.0.0": osinfo = "macOS Mojave (v10.14.4)"; break;

                case "18.6.0.0": osinfo = "macOS Mojave (v10.14.5)"; break;

                case "18.7.0.0": osinfo = "macOS Mojave (v10.14.6)"; break;

                case "19.0.0.0": osinfo = "macOS Catalina (v10.15)"; break;

                case "19.2.0.0": osinfo = "macOS Catalina (v10.15.2)"; break;

                case "19.3.0.0": osinfo = "macOS Catalina (v10.15.3)"; break;

                case "19.4.0.0": osinfo = "macOS Catalina (v10.15.4)"; break;

                case "19.5.0.0": osinfo = "macOS Catalina (v10.15.5)"; break;

                case "19.6.0.0": osinfo = "macOS Catalina (v10.15.7)"; break;

                case "20.0.0.0": osinfo = "macOS Big Sur (v11.0.0)"; break;

                case "20.1.0.0": osinfo = "macOS Big Sur (v11.0.1)"; break;

                case "20.3.0.0": osinfo = "macOS Big Sur (v11.1.0)"; break;

                default: osinfo = "macOS (v" + osversion + ")"; break;
                }
            }
            else
            {
                osinfo = Environment.OSVersion.ToString();
            }

            clrinfo = SharedClasses.Utility.GetRuntimeVersion();

            meminfo = (GC.GetTotalMemory(false) / 1024 / 1024).ToString("#") + " MB managed, " + (Environment.WorkingSet / 1024 / 1024).ToString("#") + " MB total";

            var container1 = new DynamicLayout()
            {
                Padding = new Padding(10)
            };

            container1.CreateAndAddDescriptionRow("DWSIM is released under the terms of the GNU General Public License (GPL) version 3.");
            container1.CreateAndAddTwoLabelsRow2("OS Info:", osinfo);
            container1.CreateAndAddTwoLabelsRow2("CLR Info:", clrinfo);
            container1.CreateAndAddTwoLabelsRow2("Memory Usage:", meminfo);

            var listcontainer = new GridView {
                DataStore = components, RowHeight = (int)(sf * 20)
            };
            var listcontainern = new GridView {
                DataStore = componentsn, RowHeight = (int)(sf * 20)
            };

            var col1 = new GridColumn
            {
                DataCell = new TextBoxCell {
                    Binding = Binding.Property <ComponentInfo, string>(r => r.Name)
                },
                HeaderText = "Name"
            };

            col1.AutoSize = true;
            listcontainer.Columns.Add(col1);
            var col1a = new GridColumn
            {
                DataCell = new TextBoxCell {
                    Binding = Binding.Property <ComponentInfo, string>(r => r.Version)
                },
                HeaderText = "Version"
            };

            col1a.AutoSize = true;
            listcontainer.Columns.Add(col1a);
            var col1b = new GridColumn
            {
                DataCell = new TextBoxCell {
                    Binding = Binding.Property <ComponentInfo, string>(r => r.Year)
                },
                HeaderText = "Year"
            };

            col1b.AutoSize = true;
            listcontainer.Columns.Add(col1b);
            var col1c = new GridColumn
            {
                DataCell = new TextBoxCell {
                    Binding = Binding.Property <ComponentInfo, string>(r => r.Copyright)
                },
                HeaderText = "Copyright"
            };

            col1c.AutoSize = true;
            listcontainer.Columns.Add(col1c);
            var col1d = new GridColumn
            {
                DataCell = new TextBoxCell {
                    Binding = Binding.Property <ComponentInfo, string>(r => r.Website)
                },
                HeaderText = "Website"
            };

            col1d.AutoSize = true;
            listcontainer.Columns.Add(col1d);
            var col1e = new GridColumn
            {
                DataCell = new TextBoxCell {
                    Binding = Binding.Property <ComponentInfo, string>(r => r.License)
                },
                HeaderText = "License"
            };

            col1e.AutoSize = true;
            listcontainer.Columns.Add(col1e);
            var col1f = new GridColumn
            {
                DataCell = new TextBoxCell {
                    Binding = Binding.Property <ComponentInfo, string>(r => r.LicenseText)
                },
                HeaderText = "License Text"
            };

            col1f.AutoSize = true;
            listcontainer.Columns.Add(col1f);


            var col1n = new GridColumn
            {
                DataCell = new TextBoxCell {
                    Binding = Binding.Property <ComponentInfo, string>(r => r.Name)
                },
                HeaderText = "Name"
            };

            col1n.AutoSize = true;
            listcontainern.Columns.Add(col1n);
            var col1an = new GridColumn
            {
                DataCell = new TextBoxCell {
                    Binding = Binding.Property <ComponentInfo, string>(r => r.Version)
                },
                HeaderText = "Version"
            };

            col1an.AutoSize = true;
            listcontainern.Columns.Add(col1an);
            var col1fn = new GridColumn
            {
                DataCell = new TextBoxCell {
                    Binding = Binding.Property <ComponentInfo, string>(r => r.LicenseText)
                },
                HeaderText = "License Text"
            };

            col1fn.AutoSize = true;
            listcontainern.Columns.Add(col1fn);

            string gpltext;

            using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("DWSIM.UI.Forms.Resources.TextFiles.gpl-3.0.txt"))
                using (StreamReader reader = new StreamReader(stream))
                {
                    gpltext = reader.ReadToEnd();
                }

            var txt1 = new TextArea {
                Text = gpltext, ReadOnly = true, Font = Fonts.Monospace(10.0f)
            };

            var t1 = new TableLayout(new TableRow(txt1));

            var tab1 = new TabPage {
                Content = container1, Text = "General Information"
            };
            var tab2 = new TabPage {
                Content = new Scrollable {
                    Content = t1
                }, Text = "GPLv3 License"
            };
            var tab3 = new TabPage {
                Content = new Scrollable {
                    Content = listcontainer
                }, Text = "External Components"
            };
            var tab4 = new TabPage {
                Content = new Scrollable {
                    Content = listcontainern
                }, Text = "NuGet Packages"
            };

            var tabc = new TabControl();

            tabc.Pages.Add(tab1);
            tabc.Pages.Add(tab2);
            tabc.Pages.Add(tab3);
            tabc.Pages.Add(tab4);

            var tablecontainer = new TableLayout {
                Padding = new Padding(10), Spacing = new Size(5, 5)
            };

            tablecontainer.Rows.Add(new TableRow(layout));
            tablecontainer.Rows.Add(new TableRow(tabc));

            Content = tablecontainer;
        }
Exemple #59
0
        public void LlenarGridConsulta()
        {
            DgvGeneral.Columns.Clear();

            DgvGeneral.OptionsView.ColumnAutoWidth = false;
            DataViewManager dvm    = new DataViewManager(dsConsulta);
            DataView        dvMain = dvm.CreateDataView(dsConsulta.Tables[0]);

            DgvGeneral.OptionsBehavior.AutoPopulateColumns = false;
            GctrlGeneral.DataSource = dvMain;

            if (Modo != "GET")
            {
                string[] captions = new[] { "Id", "Código", "Nombre", "Identificación", "Carnet", "Curso", "Estado", "Email" };

                GridColumn[] col = new GridColumn[dsConsulta.Tables[0].Columns.Count];
                for (int i = 0; i < dsConsulta.Tables[0].Columns.Count; i++)
                {
                    col[i] = DgvGeneral.Columns.AddField(dsConsulta.Tables[0].Columns[i].Caption.Trim());
                    col[i].VisibleIndex = i;
                    col[i].Caption      = captions[i];
                    col[i].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;

                    if (i == 0 || i == 3)
                    {
                        col[i].Visible = false;
                    }
                }

                DgvGeneral.Columns[1].Width = 75;
                DgvGeneral.Columns[2].Width = 200;
                //DgvGeneral.Columns[3].Width = 80;
                DgvGeneral.Columns[4].Width = 80;
                DgvGeneral.Columns[5].Width = 80;
                DgvGeneral.Columns[6].Width = 80;
                DgvGeneral.Columns[7].Width = 150;

                DgvGeneral.Columns[1].AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
                DgvGeneral.Columns[6].AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
            }
            else
            {
                string[] captions = new[] { "Código", "Nombre", "Carnet" };

                GridColumn[] col = new GridColumn[dsConsulta.Tables[0].Columns.Count];
                for (int i = 0; i < dsConsulta.Tables[0].Columns.Count; i++)
                {
                    col[i] = DgvGeneral.Columns.AddField(dsConsulta.Tables[0].Columns[i].Caption.Trim());
                    col[i].VisibleIndex = i;
                    col[i].Caption      = captions[i];
                    col[i].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;

                    //if (i == 0)
                    //{
                    //    col[i].Visible = false;
                    //}
                }

                DgvGeneral.Columns[0].Width = 90;
                DgvGeneral.Columns[1].Width = 300;
                DgvGeneral.Columns[2].Width = 95;
            }

            Funciones.getInstancia().Configurar_Grid(DgvGeneral);
            DgvGeneral.OptionsCustomization.AllowSort = true;
            DgvGeneral.OptionsFind.AlwaysVisible      = true;
            DgvGeneral.OptionsView.ColumnAutoWidth    = false;
        }
Exemple #60
0
 public void OnCellFormatting(GridColumn column, object item, int row, NSCell cell)
 {
     Widget.OnCellFormatting(new MacCellFormatArgs(column, item, row, cell));
 }