Ejemplo n.º 1
0
        public InsertMaterial(Configuration Conf)
        {
            InitializeComponent();
            conf = Conf;

            Text = "Добавить материал";
        }
Ejemplo n.º 2
0
        public InsertDevice(Configuration Conf, int ItemId, BaseDeviceType DevType)
        {
            InitializeComponent();

            conf = Conf;
            devType = DevType;
            itemId = ItemId;

            this.Text = devType == BaseDeviceType.Saw ?
                "Изменить конфигурацию пилы" : "Изменить конфигурацию шлифовального станка";

            DeviceList GoalList = devType == BaseDeviceType.Saw ?
                conf.Saws : conf.Grinders;

            int DeviceIndex = GoalList.GetIndexById(itemId);

            textBox1.Text = GoalList[DeviceIndex].Text;
            textBox2.Text = GoalList[DeviceIndex].Responsible;
            textBox4.Text = GoalList[DeviceIndex].ServiceTimePeriod.ToString();
            textBox5.Text = GoalList[DeviceIndex].ServiceTime.ToString();

            DefaultMaterialId = GoalList[DeviceIndex].DefaultMaterialId;

            for (int i = 0; i < GoalList[DeviceIndex].SupportedMaterials.Count; i++)
            {
                mpl.Add((MaterialPair)GoalList[DeviceIndex].SupportedMaterials[i].Clone());
            }

            LoadMaterials();
            LoadSupMaterials();
        }
Ejemplo n.º 3
0
        public InsertOrder(Configuration Conf, int ItemId)
        {
            InitializeComponent();

            conf = Conf;
            itemId = ItemId;

            LoadCustomers();

            int OrderIndex = conf.Orders.GetIndexById(itemId);

            textBox1.Text = conf.Orders[OrderIndex].Id.ToString();

            if (conf.Orders[OrderIndex].DeadLine != null)
            {
                checkBox1.Checked = true;
                dateTimePicker2.Value = conf.Orders[OrderIndex].DeadLine.Value;
            }

            foreach (ComboBoxItem item in comboBox1.Items)
            {
                if (item.Id == conf.Orders[OrderIndex].CustomerId)
                {
                    comboBox1.SelectedItem = item;
                    break;
                }
            }

            dateTimePicker1.Value = conf.Orders[OrderIndex].Date;
        }
Ejemplo n.º 4
0
        public InsertCustomer(Configuration Сonf)
        {
            InitializeComponent();

            conf = Сonf;

            this.Text = "Добавить нового клиента";
        }
Ejemplo n.º 5
0
        public InsertOrder(Configuration Conf)
        {
            InitializeComponent();

            conf = Conf;
            textBox1.Text = conf.Orders.GetFreeId().ToString();

            LoadCustomers();
        }
Ejemplo n.º 6
0
        public InsertMaterial(Configuration Conf, int ItemId)
        {
            InitializeComponent();
            conf = Conf;
            itemId = ItemId;
            Text = "Изменить материал";

            int itemIndex = conf.Materials.GetIndexById(itemId);
            textBox1.Text = conf.Materials[itemIndex].Text;
            textBox2.Text = conf.Materials[itemIndex].SawingTime.ToString();
            textBox3.Text = conf.Materials[itemIndex].PolishingTime.ToString();
            textBox4.Text = conf.Materials[itemIndex].Description;
        }
Ejemplo n.º 7
0
        public InsertCustomer(Configuration Сonf, int ItemId)
        {
            InitializeComponent();

            conf = Сonf;
            itemId = ItemId;

            this.Text = "Изменить параметры клиента";

            int CustIndex = conf.Customers.GetIndexById(itemId);
            textBox1.Text = conf.Customers[CustIndex].Text;
            textBox2.Text = conf.Customers[CustIndex].Phone;
            textBox3.Text = conf.Customers[CustIndex].Address;
        }
Ejemplo n.º 8
0
        public ConfigWindow(Configuration Conf)
        {
            InitializeComponent();
            original_conf = Conf;
            conf = (Configuration)original_conf.Clone();

            LoadMaterials();
            LoadSaws();
            LoadGrinders();
            LoadProtucts();
            LoadCustomers();
            LoadOrders();
            dateTimePicker1.Value = conf.BaseTime;
        }
Ejemplo n.º 9
0
        public InsertProduction(Configuration Conf, int ItemId)
        {
            InitializeComponent();
            conf = Conf;
            itemId = ItemId;
            Text = "Изменить продукцию";

            int ProdIndex = conf.Productions.GetIndexById(ItemId);

            textBox1.Text = conf.Productions[ProdIndex].Text;
            ProductionSizeList psl = conf.Productions[ProdIndex].SupSizes;
            foreach (ProductionSize item in psl)
            {
                listBox1.Items.Add(item.Clone());
            }
        }
Ejemplo n.º 10
0
        public InsertDevice(Configuration Conf, BaseDeviceType DevType)
        {
            InitializeComponent();

            conf = Conf;
            devType = DevType;

            if (devType == BaseDeviceType.Saw)
            {
                this.Text = "Добавить новую пилу";
            }

            this.Text = devType == BaseDeviceType.Saw ?
                "Добавить новую пилу" : "Добавить шлифовальный станок";

            LoadMaterials();
        }
Ejemplo n.º 11
0
        public object Clone()
        {
            Configuration clone = new Configuration();

            clone.baseTime = baseTime;
            clone.materials = (MaterialList)materials.Clone();
            clone.saws = (DeviceList)saws.Clone();
            clone.grinders = (DeviceList)grinders.Clone();
            clone.productions = (ProductionList)productions.Clone();
            clone.customers = (CustomerList)customers.Clone();
            clone.orders = (OrderList)orders.Clone();
            clone.tasks = (TaskList)tasks.Clone();

            return clone;
        }
Ejemplo n.º 12
0
 public void Assign(Configuration Obj)
 {
     baseTime = Obj.baseTime;
     materials = (MaterialList)Obj.materials.Clone();
     saws = (DeviceList)Obj.saws.Clone();
     grinders = (DeviceList)Obj.grinders.Clone();
     productions = (ProductionList)Obj.productions.Clone();
     customers = (CustomerList)Obj.customers.Clone();
     orders = (OrderList)Obj.orders.Clone();
     tasks = (TaskList)Obj.tasks.Clone();
 }
Ejemplo n.º 13
0
 public InsertProduction(Configuration Conf)
 {
     InitializeComponent();
     conf = Conf;
     Text = "Добавить продукцию";
 }