Пример #1
0
        public override sealed void DrawControls()
        {
            if (IsLoad)
            {
                sourceTable = new DataTable();
                sourceTable.Columns.AddRange(new[]
                {
                    new DataColumn(ACC_ID_COLUMN, typeof(long)),
                    new DataColumn(DESCRIPTION_COLUMN, typeof(string)),
                    new DataColumn(AMOUNT_COLUMN, typeof(int)),
                    new DataColumn(MODEL_ID_COLUMN, typeof(long))
                });
                visualTable    = MainProcess.CreateTable("Accessories", 205);
                visualTable.DT = sourceTable;
                visualTable.AddColumn("Комплектующее", DESCRIPTION_COLUMN, 184);
                visualTable.AddColumn("Кол-во", AMOUNT_COLUMN, 30);
                visualTable.OnChangeSelectedRow += visualTable_OnChangeSelectedRow;
                SqlCeDataReader reader = GetData();

                while (reader.Read())
                {
                    long   id             = Convert.ToInt64(reader[ACC_ID_COLUMN]);
                    string description    = reader[DESCRIPTION_COLUMN].ToString().TrimEnd();
                    long   nomenclatureId = Convert.ToInt64(reader[MODEL_ID_COLUMN]);

                    visualTable.AddRow(id, description, 0, nomenclatureId);
                }

                visualTable.Focus();
                MainProcess.CreateButton("Ок", 15, 275, 210, 35, "ok", ok_Click);
            }
        }
Пример #2
0
        public override sealed void DrawControls()
        {
            if (IsLoad)
            {
                sourceTable = new DataTable();
                sourceTable.Columns.AddRange(new[]
                {
                    new DataColumn("Description", typeof(string))
                });
                visualTable    = MainProcess.CreateTable("Accessories", 205);
                visualTable.DT = sourceTable;
                visualTable.AddColumn("Комплектующее", "Description", 214);
                SqlCeDataReader reader = GetData();

                while (reader.Read())
                {
                    string  id  = reader["Id"].ToString().TrimEnd();
                    DataRow row = visualTable.AddRow(id);

                    rows.Add(id, row);
                }

                visualTable.Focus();
                MainProcess.CreateButton("Ок", 15, 275, 210, 35, "ok", ok_Click);
            }
        }
Пример #3
0
        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);
        }
Пример #4
0
        public override sealed void DrawControls()
        {
            if (isLoading)
            {
                int tableHeight = 230;

                selectedInfo = MainProcess.CreateLabel(
                    "<не обрано>", 0, 60, 240, MobileFontSize.Normal, MobileFontPosition.Center, MobileFontColors.Info);
                visualTable    = MainProcess.CreateTable("Table", tableHeight, 85);
                visualTable.DT = sourceTable;
                visualTable.OnChangeSelectedRow += visualTable_OnChangeSelectedRow;
                visualTable.AddColumn(headerOfDescriptionColumn, DESCRIPTION_COLUMN, 194);
                visualTable.AddColumn(string.Empty, VALUE_COLUMN, 20);
                visualTable.OnRowSelected += visualTable_OnRowSelected;
                if (listOfElements != null)
                {
                    foreach (TableData element in listOfElements)
                    {
                        visualTable.AddRow(element.Description, element.Value, element.Id);
                    }
                }

                visualTable.Focus();
            }
        }
Пример #5
0
        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();
            }
        }
Пример #6
0
        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
            }
            }
        }
Пример #7
0
        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();
        }
Пример #8
0
        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));
            }
        }
Пример #9
0
        public override sealed void DrawControls()
        {
            if (IsLoad)
            {
                sourceTable = new DataTable();
                sourceTable.Columns.AddRange(new[]
                {
                    new DataColumn("Description", typeof(string))
                });
                visualTable    = MainProcess.CreateTable("Accessories", 205);
                visualTable.DT = sourceTable;
                visualTable.AddColumn("Комплектующее", "Description", 214);

                string command = string.Format(@"SELECT DISTINCT c.Document Id
FROM {0} c 
WHERE c.TypeOfAccessory=@Type AND c.{1}=1", subTableName, dbObject.IS_SYNCED);


                using (SqlCeCommand query = dbWorker.NewQuery(command))
                {
                    query.AddParameter("Type", typeOfAccessory);

                    // Отримати дані для заповнення в таблиці
                    using (SqlCeDataReader reader = query.ExecuteReader())
                    {
                        while (reader.Read())
                        {
                            string  id  = reader["Id"].ToString().TrimEnd();
                            DataRow row = visualTable.AddRow(id);

                            rows.Add(id, row);
                        }

                        visualTable.Focus();
                        MainProcess.CreateButton("Ок", 15, 275, 210, 35, "ok", ok_Click);
                    }
                }
            }
        }
Пример #10
0
        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
        }
Пример #11
0
        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();
            }
        }
Пример #12
0
        public override void OnHotKey(KeyAction TypeOfAction)
        {
            switch (TypeOfAction)
            {
            case KeyAction.F9:

                if (CurrentControl != null)
                {
                    ShowMessage(string.Format("Left = {0}\r\nTop = {1}\r\nWidth = {2}\r\nHeight = {3}", CurrentControl.Left, CurrentControl.Top, CurrentControl.Width, CurrentControl.Height));
                }
                break;

            case KeyAction.F8:

                if (CurrentControl != null)
                {
                    Control cont = CurrentControl;
                    MainProcess.SelectNextControl(ref CurrentControl);
                    CurrentControl.Paint    += new System.Windows.Forms.PaintEventHandler(DrawBorderForSelectObject);
                    ControlColor             = CurrentControl.BackColor;
                    CurrentControl.BackColor = System.Drawing.Color.Red;
                    CurrentControl.Refresh();

                    MainProcess.RemoveControl(cont);
                }
                break;

            case KeyAction.F10:

                MainProcess.CreateLabel("label", 5, 70, 100, ControlsStyle.LabelNormal);
                if (CurrentControl == null)
                {
                    MainProcess.SelectNextControl(ref CurrentControl);
                    CurrentControl.Paint    += new System.Windows.Forms.PaintEventHandler(DrawBorderForSelectObject);
                    ControlColor             = CurrentControl.BackColor;
                    CurrentControl.BackColor = System.Drawing.Color.Red;
                    CurrentControl.Refresh();
                }
                break;

            case KeyAction.Complate:

                MainProcess.CreateTextBox(5, 100, 150, "ñreateTextBox", ControlsStyle.TextBoxNormal);
                if (CurrentControl == null)
                {
                    MainProcess.SelectNextControl(ref CurrentControl);
                    CurrentControl.Paint    += new System.Windows.Forms.PaintEventHandler(DrawBorderForSelectObject);
                    ControlColor             = CurrentControl.BackColor;
                    CurrentControl.BackColor = System.Drawing.Color.Red;
                    CurrentControl.Refresh();
                }
                break;

            case KeyAction.F12:

                var t = MainProcess.CreateTable("WareList", 30);
                if (CurrentControl == null)
                {
                    MainProcess.SelectNextControl(ref CurrentControl);
                    CurrentControl.Paint    += new System.Windows.Forms.PaintEventHandler(DrawBorderForSelectObject);
                    ControlColor             = CurrentControl.BackColor;
                    CurrentControl.BackColor = System.Drawing.Color.Red;
                    CurrentControl.Refresh();
                }
                t.Show();
                break;

            case KeyAction.F5:

                if (CurrentControl != null)
                {
                    CurrentControl.BackColor = ControlColor;
                    CurrentControl.Paint    -= new System.Windows.Forms.PaintEventHandler(DrawBorderForSelectObject);
                }

                MainProcess.SelectNextControl(ref CurrentControl);
                CurrentControl.Paint    += new System.Windows.Forms.PaintEventHandler(DrawBorderForSelectObject);
                ControlColor             = CurrentControl.BackColor;
                CurrentControl.BackColor = System.Drawing.Color.Red;
                CurrentControl.Refresh();
                break;

            case KeyAction.Recount:

                MoveObjectsState = !MoveObjectsState;
                break;

            case KeyAction.UpKey:

                if (CurrentControl == null)
                {
                    break;
                }

                if (MoveObjectsState)
                {
                    CurrentControl.Top--;
                }
                else
                {
                    CurrentControl.Height--;
                }
                break;

            case KeyAction.DownKey:

                if (CurrentControl == null)
                {
                    break;
                }
                if (MoveObjectsState)
                {
                    CurrentControl.Top++;
                }
                else
                {
                    CurrentControl.Height++;
                }
                break;

            case KeyAction.LeftKey:

                if (CurrentControl == null)
                {
                    break;
                }

                if (MoveObjectsState)
                {
                    CurrentControl.Left--;
                }
                else
                {
                    CurrentControl.Width--;
                }
                break;

            case KeyAction.RightKey:

                if (CurrentControl == null)
                {
                    break;
                }
                if (MoveObjectsState)
                {
                    CurrentControl.Left++;
                }
                else
                {
                    CurrentControl.Width++;
                }
                break;
            }
        }