public MobileTable CreateTable(string controlName, int height, int top, Void2paramDelegate <object, OnRowSelectedEventArgs> onRowSelected) { MobileTable NewControl = new MobileTable(MainForm, controlName, height, top, onRowSelected); ControlsArray.Add(NewControl); return(NewControl); }
public override sealed void DrawControls() { if (IsLoad) { visualTable = MainProcess.CreateTable("Maps", 259, onRowSelected); visualTable.DT = sourceTable; visualTable.AddColumn("Карта", "Description", 214); using (SqlCeCommand query = dbWorker.NewQuery("SELECT Id,Description FROM Maps WHERE ParentId=@Id ORDER BY Description") ) { query.AddParameter("Id", CurrentMapId); using (SqlCeDataReader reader = query.ExecuteReader()) { while (reader.Read()) { visualTable.AddRow(reader["Description"], reader["Id"]); } } } visualTable.Focus(); } }
/// <summary>Обьединение контролов "частичных значений" в единое значение</summary> /// <returns>Новое значение свойства</returns> private string concatValue() { StringBuilder valueBuilder = new StringBuilder(); foreach (MobileControl control in controls) { MobileTextBox tb = control as MobileTextBox; if (tb != null) { valueBuilder.Append(tb.Text); continue; } MobileLabel l = control as MobileLabel; if (l != null) { valueBuilder.Append(l.Text); continue; } MobileTable t = control as MobileTable; if (t != null) { valueBuilder.Append(selectedId); } } return(valueBuilder.ToString()); }
private void createEnumControls(Type vType) { DataTable sourceTable = new DataTable(); sourceTable.Columns.AddRange(new[] { new DataColumn("Number", typeof(int)), new DataColumn("Description", typeof(string)) }); MobileTable visualTable = MainProcess.CreateTable("Enum", 200, 65); visualTable.OnChangeSelectedRow += visualTable_OnChangeSelectedRow; visualTable.DT = sourceTable; visualTable.AddColumn("№", "Number", 34); visualTable.AddColumn("Назва", "Description", 180); Dictionary <int, string> list = EnumWorker.GetList(vType); foreach (KeyValuePair <int, string> element in list) { visualTable.AddRow(element.Key, element.Value); } visualTable.Focus(); controls.Add(visualTable); }
public override void DrawControls() { switch (processStep) { case Steps.DocumentSelecting: { #region Выбор документа //PerformQuery("ПолучитьСписокПланаПриходаТары"); //if (Parameters == null || Parameters[0] == null) //{ // ShowMessage("Подойдите в зону беспроводного покрытия"); // MainProcess.Process = new SelectingProcess(MainProcess); // return; //} //dataTable = Parameters[0] as DataTable; //if (dataTable.Rows.Count == 0) //{ // ShowMessage("Нет запланированных документов для приема расходных материалов!"); // MainProcess.Process = new SelectingProcess(MainProcess); // return; //} TableControl = MainProcess.CreateTable("WareList", 259); TableControl.OnKeyPressedEvent = OnDataGridViewKeyPress; docsVisual = TableControl.GetControl() as DataGrid; MainProcess.ToDoCommand = "Выберите документ"; break; #endregion } case Steps.Incoming: { #region Пересчет расходных материалов MainProcess.ClearControls(); nomenclatureLabel = MainProcess.CreateLabel("<Ожидается код>", 19, 59, 215, ControlsStyle.LabelNormal).GetControl() as Label; MainProcess.CreateLabel("Запланировано:", 19, 93, 201, ControlsStyle.LabelNormal); planLabel = MainProcess.CreateLabel("0 / 0", 19, 120, 201, ControlsStyle.LabelRedRightAllign).GetControl() as Label; MainProcess.CreateLabel("Принято:", 19, 150, 201, ControlsStyle.LabelNormal); realLabel = MainProcess.CreateLabel("0 / 0", 19, 177, 201, ControlsStyle.LabelRedRightAllign).GetControl() as Label; actedLabel = MainProcess.CreateLabel("Количество брака:", 19, 228, 201, ControlsStyle.LabelNormal).GetControl() as Label; actedTextBox = MainProcess.CreateTextBox(136, 262, 81, "", ControlsStyle.LabelRedRightAllign, OnEnterToActTextbox, false).GetControl() as TextBox; uniqueCodeLabel = MainProcess.CreateLabel("Отмена - Esc", 19, 290, 201, ControlsStyle.LabelNormal).GetControl() as Label; actedLabel.Visible = false; actedTextBox.Visible = false; MainProcess.ToDoCommand = "ПРИЕМ РАСХ. МАТЕРИАЛОВ"; break; #endregion } } }
public override void DrawControls() { InitDatabase(); if (!isEmptyCriterions) { isEmptyCriterions = ShowQuery("Выполнить обновление номенклатуры и критериев оценивания?"); } if (isEmptyCriterions) { if (!UpdateRules()) { throw new ConnectionIsNotExistsException("нужно обновить критерии оценивания и номенклатуру!"); } } MainProcess.ClearControls(); MainProcess.ToDoCommand = "Регистрация качества"; labelControl = (MainProcess.CreateLabel("", 5, 59, 229, 39, ControlsStyle.LabelMultilineSmall).GetControl()) as Label; textBoxControl = (MainProcess.CreateTextBox(0, 0, 0, "", ControlsStyle.LabelH2, onTextBoxEndEdit, false)).GetControl() as TextBox; textBoxControl.LostFocus += new EventHandler(textBoxControl_LostFocus); textBoxControl.Hide(); Nomenclature = ""; #region Создание рабочей таблицы var dataTable = new DataTable(); dataTable.Columns.AddRange(new DataColumn[] { new DataColumn("CriterionName", typeof(string)), new DataColumn("CriterionId", typeof(long)), new DataColumn("Mark", typeof(int)), new DataColumn("HaveSubCriterion", typeof(bool)), new DataColumn("ParentCriterionId", typeof(long)) }); #endregion table = MainProcess.CreateTable("operations", 217, 99, onRowSelected); table.DT = dataTable; table.AddColumn("Критерий", "CriterionName", 180); table.AddColumn("Балл", "Mark", 34); table.Focus(); }
private void createLongControls() { dbFieldAtt attribute = Attribute.GetCustomAttribute( accessory.GetType().GetProperty(propertyName), typeof(dbFieldAtt)) as dbFieldAtt; if (attribute != null && attribute.dbObjectType != null) { DataTable sourceTable = new DataTable(); sourceTable.Columns.AddRange(new[] { new DataColumn("Number", typeof(int)), new DataColumn("Description", typeof(string)) }); MobileTable visualTable = MainProcess.CreateTable("Table", 200, 65); visualTable.OnChangeSelectedRow += visualTable_OnChangeSelectedRow; visualTable.DT = sourceTable; visualTable.AddColumn("№", "Number", 34); visualTable.AddColumn("Назва", "Description", 180); string command = string.Format("SELECT Id,Description FROM {0} WHERE MarkForDeleting=0", attribute.dbObjectType.Name); DataTable table = null; using (SqlCeCommand query = dbWorker.NewQuery(command)) { table = query.SelectToTable(); } foreach (DataRow row in table.Rows) { visualTable.AddRow(row["Id"], row["Description"]); } visualTable.Focus(); controls.Add(visualTable); } else { MainProcess.CreateLabel("Справочник/Документ пуст!", 5, 150, 230, MobileFontSize.Normal, MobileFontPosition.Center, MobileFontColors.Warning, FontStyle.Bold); controls.Add(MainProcess.CreateTable("Table", 200, 65)); } }
public override void DrawControls() { MainProcess.ToDoCommand = "Выберите операцию"; #region Создание меню операций var dataTable = new DataTable(); dataTable.Columns.AddRange(new[] { new DataColumn("OperationName", typeof(string)), new DataColumn("type", typeof(short)) }); table = MainProcess.CreateTable("operations", 259, onRowSelected); table.DT = dataTable; table.AddColumn("Операция", "OperationName", 214); table.AddRow("Прием расх. материалов", 1); table.AddRow("Регистрация качества", 2); table.AddRow("Регистрация качества несорт.", 3); table.Focus(); #endregion }
public override sealed void DrawControls() { if (IsLoad) { DataTable sourceTable = new DataTable(); sourceTable.Columns.AddRange(new[] { new DataColumn("Position", typeof(string)) }); MobileTable visualTable = MainProcess.CreateTable("Positions", 259, onRowSelected); visualTable.DT = sourceTable; visualTable.AddColumn("№Позиции", "Position", 214); List <object> list = getFilledPosition(); int maxNumber = Maps.GetMaxPositionNumber(MapInfo.Id); for (int i = 1; i <= maxNumber; i++) { if (!list.Contains(i)) { visualTable.AddRow(i); } } visualTable.Focus(); } }
public MobileTable CreateTable(string controlName, int height, int top, Void2paramDelegate<object, OnRowSelectedEventArgs> onRowSelected) { MobileTable NewControl = new MobileTable(MainForm, controlName, height, top, onRowSelected); ControlsArray.Add(NewControl); return NewControl; }