Пример #1
0
        private void Start_button_Click(object sender, EventArgs e)
        {
            Microsoft.Win32.RegistryKey clientname = null;
            try
            {
                clientname = Microsoft.Win32.Registry.CurrentUser.CreateSubKey("Software\\Bobcalc");
                if (clientname != null)
                {
                    clientname.SetValue("ClientName", "");
                }
                clientname.SetValue("ClientEmail", "");
                clientname.SetValue("ClientPhone", "");
            }
            finally
            {
                if (clientname != null)
                {
                    clientname.Close();
                }
            }

            SecPage sp = new SecPage();

            sp.Show();
            this.Hide();
        }
Пример #2
0
        /*public void ShowLoad()
         * {
         *  load load = new load();
         *  load.Show();
         *  this.checkstate = false;
         *  Thread.Sleep(1000);
         *  while (!this.checkstate)
         *  {
         *  }
         *  Thread.Sleep(1000);
         *  load.Hide();
         * }*/

        private void Add_Gate_Button_Click(object sender, EventArgs e)
        {
            bool keystart = true;
            int  rubdiscount;

            if (Global_Discount.Text != "" && Discount_Type_comboBox.Text == "₽")
            {
                rubdiscount = Convert.ToInt32(Global_Discount.Text);
            }
            else
            {
                rubdiscount = 0;
            }

            //проверка инф о клиенте
            if (ClientName_textBox.Text == "")
            {
                keystart = false;
                ClientName_textBox.BackColor = Color.Salmon;
            }

            if (ClientEmail_textBox.Text == "")
            {
                keystart = false;
                ClientEmail_textBox.BackColor = Color.Salmon;
            }

            if (ClientPhone_textBox.Text == "")
            {
                keystart = false;
                ClientPhone_textBox.BackColor = Color.Salmon;
            }
            //

            //проверка автоматики
            if (Controls_comboBox.Text != "" && ControlsCount_Box_Auto.Text == "")
            {
                keystart = false;
                ControlsCount_Box_Auto.BackColor = Color.Salmon;
            }

            //

            //Проверка работы
            if (checkBox_AutoInst.Checked == true && Work_AutoInst.Text == "")
            {
                Work_AutoInst.BackColor = Color.Salmon;
                keystart = false;
            }
            if (checkBox_Delivery.Checked == true && Work_Delivery.Text == "")
            {
                Work_Delivery.BackColor = Color.Salmon;
                keystart = false;
            }

            if (checkBox_GateInst.Checked == true && Work_GateInst.Text == "")
            {
                Work_GateInst.BackColor = Color.Salmon;
                keystart = false;
            }
            if (checkBox_PreWork.Checked == true && Work_PreWork.Text == "")
            {
                Work_PreWork.BackColor = Color.Salmon;
                keystart = false;
            }

            //
            if (keystart == true)
            {
                load ld = new Bobcalc.load();
                ld.Show();
                //Ворота
                if (Width_TextBox.Text != "")
                {
                    string OutGate = "Ворота секционные " + TypeSecComboBox.Text + " на проем " + Convert.ToString(gate.width) + " x " + Convert.ToString(gate.height);
                    string OutEx   = "Обшивка: " + gate.execution;
                    Program.Send_GW_data(OutGate, OutEx, GetPrice(), gate.discount, rubdiscount);
                }
                //

                //Автоматика
                if (Producer_Box_Auto.Text != "")
                {
                    if (Drivers_Box_Auto.Text != "")
                    {
                        switch (Drivers_Box_Auto.Text)
                        {
                        //FAAC
                        case "D100":
                            Program.Senddata("Привод D100, приемник, пульт, рельс", "комп.", 1, 18950, auto.discount, excel.excelapp, excel.excelworksheet1, rubdiscount);
                            break;


                        //Nice
                        case "Spin 21":
                            Program.Senddata("Привод Spin 21, приемник, пульт, рельс", "комп.", 1, 13040, auto.discount, excel.excelapp, excel.excelworksheet1, rubdiscount);
                            break;

                        case "Spin 22":
                            Program.Senddata("Привод Spin 22, приемник, пульт, рельс", "комп.", 1, 14600, auto.discount, excel.excelapp, excel.excelworksheet1, rubdiscount);
                            break;

                        //An-motors
                        case "ASI 50 KIT":
                            Program.Senddata("Привод ASI 50 KIT, кнопочный пост, блок управления, цепь ручного подъема", "комп.", 1, 30220, auto.discount, excel.excelapp, excel.excelworksheet1, rubdiscount);
                            break;
                        }
                    }

                    if (Controls_comboBox.Text != "")
                    {
                        switch (Controls_comboBox.Text)
                        {
                        //Faac
                        case "XT2 868 SLH":
                            Program.Senddata("Брелок-передатчик XT2 868 SLH LR 868 МГц 2-канальный SLH код", "шт.", Convert.ToInt32(ControlsCount_Box_Auto.Text), 2033, auto.discount, excel.excelapp, excel.excelworksheet1, rubdiscount);
                            break;

                        case "XT4 868 SLH":
                            Program.Senddata("Брелок-передатчик XT4 868 SLH LR 868 МГц 4-канальный SLH код", "шт.", Convert.ToInt32(ControlsCount_Box_Auto.Text), 2373, auto.discount, excel.excelapp, excel.excelworksheet1, rubdiscount);
                            break;

                        //AnMotors
                        case "AT-4":
                            Program.Senddata("4-х канальный пульт дистанционного управления AT-4", "шт.", Convert.ToInt32(ControlsCount_Box_Auto.Text), 724, auto.discount, excel.excelapp, excel.excelworksheet1, rubdiscount);
                            break;

                        //Nice
                        case "FLO2RE":
                            Program.Senddata("2-х канальный пульт управления ERA FLOR FLO2RE", "шт.", Convert.ToInt32(ControlsCount_Box_Auto.Text), 1447, auto.discount, excel.excelapp, excel.excelworksheet1, rubdiscount);
                            break;
                        }
                    }

                    if (Priemnik_comboBox.Text != "")
                    {
                        switch (Priemnik_comboBox.Text)
                        {
                        case "SMXIS":
                            Program.Senddata("Приемник встраиваемый SMXIS", "шт.", 1, 1440, auto.discount, excel.excelapp, excel.excelworksheet1, rubdiscount);
                            break;

                        case "OXI":
                            Program.Senddata("Приемник встраиваемый OXI", "шт.", 1, 2664, auto.discount, excel.excelapp, excel.excelworksheet1, rubdiscount);
                            break;

                        case "RP 2 868":
                            Program.Senddata("Приемник встраиваемый RP 2 868", "шт.", 1, 2856, auto.discount, excel.excelapp, excel.excelworksheet1, rubdiscount);
                            break;
                        }
                    }

                    if (Photoelem_comboBox.Text != "")
                    {
                        switch (Photoelem_comboBox.Text)
                        {
                        //FAAC
                        case "XP20W D":
                            Program.Senddata("Фотоэлементы XP20W D настенные, пара: приемник и передатчик c возможностью питания от батареи CR2", "шт.", 1, 4420, auto.discount, excel.excelapp, excel.excelworksheet1, rubdiscount);
                            break;

                        case "XP20 D":
                            Program.Senddata("Фотоэлементы XP20 D настенные, пара: приемник и передатчик", "шт.", 1, 3740, auto.discount, excel.excelapp, excel.excelworksheet1, rubdiscount);
                            break;

                        //AnMotors
                        case "P5103":
                            Program.Senddata("Фотоэлементы IR", "шт.", 1, 2500, auto.discount, excel.excelapp, excel.excelworksheet1, rubdiscount);
                            break;

                        //Nice
                        case "EPMB":
                            Program.Senddata("Фотоэлементы Medium BlueBus EPMB", "шт.", 1, 4032, auto.discount, excel.excelapp, excel.excelworksheet1, rubdiscount);
                            break;
                        }
                    }

                    if (Lamp_checkBox.Checked == true)
                    {
                        switch (Producer_Box_Auto.Text)
                        {
                        case "Nice":
                            Program.Senddata("Лампа сигнальная с антенной, 12В ELB", "шт.", 1, 2232, auto.discount, excel.excelapp, excel.excelworksheet1, rubdiscount);
                            break;

                        case "FAAC":
                            Program.Senddata("Лампа сигнальная FAACLIGHT, питание ~ 230В, 40Вт", "шт.", 1, 2040, auto.discount, excel.excelapp, excel.excelworksheet1, rubdiscount);
                            break;

                        case "An - Motors":
                            Program.Senddata("Сигнальная лампа F5002 230В с кронштейном крепления", "шт.", 1, 1083, auto.discount, excel.excelapp, excel.excelworksheet1, rubdiscount);
                            break;

                        case "Comunello":
                            Program.Senddata("Сигнальная лампа SWIFT светодиодная универсальная со встроенной антеной и кронштейном крепления", "шт.", 1, 2150, auto.discount, excel.excelapp, excel.excelworksheet1, rubdiscount);
                            break;
                        }
                    }
                }

                if (Reductor_checkBox.Checked == true)
                {
                    Program.Senddata("Редуктор с цепью", "шт.", 1, 7040, auto.discount, excel.excelapp, excel.excelworksheet1, rubdiscount);
                }

                if (BlokRP_checkBox.Checked == true)
                {
                    Program.Senddata("Блок ручного управления", "шт.", 1, 1500, auto.discount, excel.excelapp, excel.excelworksheet1, rubdiscount);
                }

                if (Zamok_checkBox.Checked == true)
                {
                    Program.Senddata("Замок ригельный", "шт.", 1, 6067, auto.discount, excel.excelapp, excel.excelworksheet1, rubdiscount);
                }
                //

                //Калитка
                if (this.Wicket_checkBox.Checked)
                {
                    if (this.TypeSecComboBox.Text == "Classic")
                    {
                        Program.Senddata("Калитка встроенная", "шт.", 1, 35489, this.wicket.discount, excel.excelapp, excel.excelworksheet1, rubdiscount);
                    }
                    if (this.TypeSecComboBox.Text == "Trend")
                    {
                        Program.Senddata("Калитка встроенная", "шт.", 1, 28702, this.wicket.discount, excel.excelapp, excel.excelworksheet1, rubdiscount);
                    }
                }
                //

                //Дополнительные позиции
                if (DopName1.Text != "" && DopCount1.Text != "" && DopPrice1.Text != "")
                {
                    Program.Senddata(DopName1.Text, "", Convert.ToInt32(DopCount1.Text), Convert.ToInt32(DopPrice1.Text), doppos.discount, excel.excelapp, excel.excelworksheet1, rubdiscount);
                }
                if (DopName2.Text != "" && DopCount2.Text != "" && DopPrice2.Text != "")
                {
                    Program.Senddata(DopName2.Text, "", Convert.ToInt32(DopCount2.Text), Convert.ToInt32(DopPrice2.Text), doppos.discount, excel.excelapp, excel.excelworksheet1, rubdiscount);
                }
                if (DopName3.Text != "" && DopCount3.Text != "" && DopPrice3.Text != "")
                {
                    Program.Senddata(DopName3.Text, "", Convert.ToInt32(DopCount3.Text), Convert.ToInt32(DopPrice3.Text), doppos.discount, excel.excelapp, excel.excelworksheet1, rubdiscount);
                }
                if (DopName4.Text != "" && DopCount4.Text != "" && DopPrice4.Text != "")
                {
                    Program.Senddata(DopName4.Text, "", Convert.ToInt32(DopCount4.Text), Convert.ToInt32(DopPrice4.Text), doppos.discount, excel.excelapp, excel.excelworksheet1, rubdiscount);
                }
                if (DopName5.Text != "" && DopCount5.Text != "" && DopPrice5.Text != "")
                {
                    Program.Senddata(DopName5.Text, "", Convert.ToInt32(DopCount5.Text), Convert.ToInt32(DopPrice5.Text), doppos.discount, excel.excelapp, excel.excelworksheet1, rubdiscount);
                }
                //

                //Работа
                if (checkBox_AutoInst.Checked == true && Work_AutoInst.Text != "")
                {
                    Program.Senddata("Установка автоматики", "", 1, Convert.ToInt32(Work_AutoInst.Text), works.discount, excel.excelapp, excel.excelworksheet1, rubdiscount);
                }
                if (checkBox_Delivery.Checked == true && Work_Delivery.Text != "")
                {
                    Program.Senddata("Доставка", "", 1, Convert.ToInt32(Work_Delivery.Text), works.discount, excel.excelapp, excel.excelworksheet1, rubdiscount);
                }

                if (checkBox_GateInst.Checked == true && Work_GateInst.Text != "")
                {
                    Program.Senddata("Установка ворот", "", 1, Convert.ToInt32(Work_GateInst.Text), works.discount, excel.excelapp, excel.excelworksheet1, rubdiscount);
                }
                if (checkBox_PreWork.Checked == true && Work_PreWork.Text != "")
                {
                    Program.Senddata("Подготовительные работы", "", 1, Convert.ToInt32(Work_PreWork.Text), works.discount, excel.excelapp, excel.excelworksheet1, rubdiscount);
                }
                //

                Excel.Range cell = (Excel.Range)excel.excelworksheet1.Cells[7, 3];
                cell.Value = ClientName_textBox.Text;

                cell       = (Excel.Range)excel.excelworksheet1.Cells[8, 3];
                cell.Value = ClientPhone_textBox.Text;

                cell       = (Excel.Range)excel.excelworksheet1.Cells[9, 3];
                cell.Value = ClientEmail_textBox.Text;

                SecPage pag = new SecPage();
                pag.Show();
                ld.Close();
                this.Hide();
            }
        }