private void BtDelete_Click(object sender, RoutedEventArgs e)
        {
            Action action = () =>
            {
                if (MessageBox.Show("Вы действительно хотите удалить запись?", "ParawosoffApp", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes)
                {
                    ArrayList array = new ArrayList();
                    array.Add(tbProductID.Text);
                    if (MessageBox.Show("Удалить все связанные записи?", "ParawosoffApp", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes)
                    {
                        array.Add("1");
                    }
                    else
                    {
                        array.Add("0");
                    }
                    Procedure_Class procedure = new Procedure_Class();
                    procedure.procedure_Execution("Product_LogDelete", array);
                    ProductFill();
                    tbProductID.Clear();
                }
            };

            action.Invoke();
        }
예제 #2
0
        private void BtEnter_Click(object sender, RoutedEventArgs e)
        {
            Action action = () =>
            {
                ArrayList array = new ArrayList();
                array.Add(App.intID);
                array.Add(Surname);
                array.Add(Name);
                array.Add(Firstname);
                array.Add(Recruitment);
                array.Add(Exp);
                DES    des = DES.Create();
                byte[] key = Convert.FromBase64String("WdbWuvWCHPc=");
                byte[] IV  = Convert.FromBase64String("RuBs2bQBW58=");
                des.Key = key;
                des.IV  = IV;
                byte[] login  = Crypt_Class.SymmetricEncrypt(tbLogin.Text, des);
                byte[] passwd = Crypt_Class.SymmetricEncrypt(tbPassword.Text, des);
                array.Add(Convert.ToBase64String(login));
                array.Add(Convert.ToBase64String(passwd));
                array.Add(Pos);
                Procedure_Class procedure = new Procedure_Class();
                procedure.procedure_Execution("Staff_Update", array);
                MessageBox.Show("Данные успешно изменены", "ParawosoffApp", MessageBoxButton.OK, MessageBoxImage.Information);
                BasicsSelect();
                this.Hide();
                Owner.Show();
            };

            action.Invoke();
        }
예제 #3
0
        private void BtEnter_Click(object sender, RoutedEventArgs e)
        {
            Action action = () =>
            {
                Procedure_Class procedure = new Procedure_Class();
                ArrayList       array     = new ArrayList();
                Table_Class     number    = new Table_Class(String.Format("select count (*) +1 from [dbo].[Order] where [Staff_ID] = {0}", SelectedID));
                switch (cbType.SelectedIndex)
                {
                case (0):
                    array.Add(String.Format("Увольнение сотрудника {0}", SelectedID));
                    array.Add(String.Format("Уволить сотрудника {0} по причине: {1}. Дата (местная): {2}", lblCurStaff.Content, tbText.Text, DateTime.Now.ToString()));
                    array.Add(SelectedID);
                    procedure.procedure_Execution("Order_Insert", array);
                    array.Clear();
                    array.Add(SelectedID);
                    array.Add("1");
                    procedure.procedure_Execution("Staff_LogDelete", array);
                    array.Clear();
                    break;

                case (1):
                    Table_Class pos = new Table_Class(String.Format("select [PositionName] from [dbo].[Position] where [ID_Position] = \'{0}\'", cbPosition.SelectedValue.ToString()));
                    array.Add(String.Format("Перевод сотрудника {0} (№ {1})", SelectedID, number.table.Rows[0][0].ToString()));
                    array.Add(String.Format("Перевести сотрудника {0} на должность {1} по причине: {2}. Дата (местная): {3}", lblCurStaff.Content, pos.table.Rows[0][0].ToString(), tbText.Text, DateTime.Now.ToString()));
                    array.Add(SelectedID);
                    procedure.procedure_Execution("Order_Insert", array);
                    array.Clear();
                    array.Add(SelectedID);
                    array.Add(cbPosition.SelectedValue.ToString());
                    procedure.procedure_Execution("Staff_Reposition", array);
                    array.Clear();
                    break;

                case (2):
                    array.Add(String.Format("Особый приказ для сотрудника {0} (№ {1})", SelectedID, number.table.Rows[0][0].ToString()));
                    array.Add(String.Format("{1}. Сотрудник: {0}. Дата (местная): {2}", lblCurStaff.Content, tbText.Text, DateTime.Now.ToString()));
                    array.Add(SelectedID);
                    procedure.procedure_Execution("Order_Insert", array);
                    break;
                }
                cbType.SelectedIndex     = -1;
                cbPosition.SelectedIndex = -1;
                tbText.Clear();
            };

            action.Invoke();
            this.Hide();
            (Owner as ManagerInterface).TableRefresh();
            Owner.Show();
        }
예제 #4
0
        private void BtEnter_Click(object sender, RoutedEventArgs e)
        {
            Action action = () =>
            {
                ArrayList array = new ArrayList();
                array.Add(tbStaffID.Text);
                array.Add(tbName.Text);
                array.Add(tbSalary.Text);
                Procedure_Class procedure = new Procedure_Class();
                procedure.procedure_Execution("Pos_Update", array);
                tbStaffID.Clear();
            };

            action.Invoke();
            PosFill();
        }
        private void BtTypeInsert_Click(object sender, RoutedEventArgs e)
        {
            Action action = () =>
            {
                ArrayList array = new ArrayList();
                array.Add(tbTypeName.Text);
                array.Add(tbTerms.Text);
                Procedure_Class procedure = new Procedure_Class();
                procedure.procedure_Execution("Type_Insert", array);
                tbTypeName.Clear();
                tbTerms.Clear();
                TypeProductFill();
            };

            action.Invoke();
        }
예제 #6
0
        private void BtApply_Click(object sender, RoutedEventArgs e)
        {
            Action action = () =>
            {
                ArrayList array = new ArrayList();
                array.Add(tbProductID.Text);
                array.Add(tbSchemeID.Text);
                Procedure_Class procedure = new Procedure_Class();
                procedure.procedure_Execution("Product_SchemeSet", array);
                ProductFill();
                tbProductID.Clear();
                tbSchemeID.Clear();
            };

            action.Invoke();
        }
        private void BtRemove_Click(object sender, RoutedEventArgs e)
        {
            Action action = () =>
            {
                ArrayList array = new ArrayList();
                array.Add(tbProductID.Text);
                array.Add(tbAmount.Text);
                array.Add("0");
                Procedure_Class procedure = new Procedure_Class();
                procedure.procedure_Execution("Product_Reamount", array);
                tbProductID.Clear();
                tbProductCurAmount.Clear();
                ProductFill();
            };

            action.Invoke();
        }
예제 #8
0
        private void BtInsert_Click(object sender, RoutedEventArgs e)
        {
            Action action = () =>
            {
                ArrayList array = new ArrayList();
                array.Add(tbName.Text);
                array.Add(tbBasis.Text);
                array.Add(tbReality.Text);
                Procedure_Class procedure = new Procedure_Class();
                procedure.procedure_Execution("Scheme_Insert", array);
                SchemeFill();
                tbName.Clear();
                tbBasis.Clear();
                tbReality.Clear();
            };

            action.Invoke();
        }
예제 #9
0
        private void BtSelect_Click(object sender, RoutedEventArgs e)
        {
            SaveFileDialog save = new SaveFileDialog();

            save.ShowDialog();
            Table_Class    table    = new Table_Class(String.Format("SELECT [Check] as \'Чек\',(select [Surname] from [dbo].[Staff] where [ID_Staff] = [Staff_ID]) as \'Фамилия\',(select [Name] from [dbo].[Staff] where [ID_Staff] = [Staff_ID]) as \'Имя\',(select [FirstName] from [dbo].[Staff] where [ID_Staff] = [Staff_ID]) as \'Отчество\', (select [Name] from [dbo].[Product] where [ID_Product] = [Product_ID]) as \'Товар\', (select [SchemeName] from [dbo].[MarkScheme] where [ID_Scheme] = (select [Scheme_ID] from [dbo].[Product] where [ID_Product] = [Product_ID])) as \'Схема\',[Amount] as \'Количество\',[SellDate] as \'Дата\',[Price] as \'Сумма\' FROM [dbo].[Sell] WHERE [Check] = \'{0}\'", tbCheck.Text));
            Document_class document = new Document_class();

            document.Document_Create(Document_class.Document_Type.Check, save.FileName, table.table);
            ArrayList array = new ArrayList();

            array.Add(tbCheck.Text);
            array.Add(save.FileName);
            Procedure_Class procedure = new Procedure_Class();

            procedure.procedure_Execution("Sell_Doc_Create", array);
            tbCheck.Clear();
        }
        private void BtSelect_Click(object sender, RoutedEventArgs e)
        {
            Action action = () =>
            {
                SaveFileDialog save = new SaveFileDialog();
                save.ShowDialog();
                Table_Class    table    = new Table_Class(String.Format("select [OrderName],[OrderText] from [dbo].[Order] WHERE [ID_Order] = {0}", tbOrderID.Text));
                Document_class document = new Document_class();
                document.Document_Create(Document_class.Document_Type.Order, save.FileName, table.table);
                ArrayList array = new ArrayList();
                array.Add(tbOrderID.Text);
                array.Add(save.FileName);
                Procedure_Class procedure = new Procedure_Class();
                procedure.procedure_Execution("Order_Doc_Create", array);
                tbOrderID.Clear();
            };

            action.Invoke();
        }
예제 #11
0
        private void BtEnter_Click(object sender, RoutedEventArgs e)
        {
            Action action = () =>
            {
                Table_Class table = new Table_Class(String.Format("select count (*) from [dbo].[Staff] where [Login] = \'{0}\'", tbLogin.Text));
                if (table.table.Rows[0][0].ToString() != "0")
                {
                    MessageBox.Show("Этот логин использовать нельзя!", "ParawosoffApp", MessageBoxButton.OK, MessageBoxImage.Error);
                }
                else
                {
                    ArrayList staff = new ArrayList();
                    staff.Add(tbFirstName.Text);
                    staff.Add(tbName.Text);
                    staff.Add(tbPatronymic.Text);
                    staff.Add(tbExp.Text);
                    DES    des = DES.Create();
                    byte[] key = Convert.FromBase64String("WdbWuvWCHPc=");
                    byte[] IV  = Convert.FromBase64String("RuBs2bQBW58=");
                    des.Key = key;
                    des.IV  = IV;
                    byte[] login  = Crypt_Class.SymmetricEncrypt(tbLogin.Text, des);
                    byte[] passwd = Crypt_Class.SymmetricEncrypt(tbPassword.Text, des);
                    staff.Add(Convert.ToBase64String(login));
                    staff.Add(Convert.ToBase64String(passwd));
                    staff.Add(cbPosition.SelectedValue.ToString());
                    Procedure_Class procedure = new Procedure_Class();
                    procedure.procedure_Execution("Staff_Insert", staff);
                    Table_Class ID    = new Table_Class("select [ID_Staff],[Timestamp] from [dbo].[Staff] WHERE [Timestamp] = (select MAX([Timestamp]) from [dbo].[Staff])");
                    ArrayList   array = new ArrayList();
                    array.Add(String.Format("Приём на работу ({0})", ID.table.Rows[0][0].ToString()));
                    Table_Class pos = new Table_Class(String.Format("select [PositionName] from [dbo].[Position] where [ID_Position] = \'{0}\'", cbPosition.SelectedValue.ToString()));
                    array.Add(String.Format("Принять сотрудника {0} {1} {2} на должность {3}. Дата: {4}", tbFirstName.Text, tbName.Text, tbPatronymic.Text, pos.table.Rows[0][0].ToString(), ID.table.Rows[0][1].ToString()));
                    array.Add(ID.table.Rows[0][0].ToString());
                    procedure.procedure_Execution("Order_Insert", array);
                    this.Hide();
                    (Owner as ManagerInterface).TableRefresh();
                    Owner.Show();
                }
            };

            action.Invoke();
        }
        private void BtUpdate_Click(object sender, RoutedEventArgs e)
        {
            Action action = () =>
            {
                ArrayList array = new ArrayList();
                array.Add(tbProductID.Text);
                array.Add(tbName.Text);
                array.Add(tbPrice.Text);
                Table_Class table = new Table_Class(String.Format("SELECT [FirstDec],[Scheme_ID]FROM [dbo].[Product] WHERE [ID_Product] = {0}", tbProductID.Text));
                if (MessageBox.Show("Изменить дату первого добавления?", "ParawosoffApp", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes)
                {
                    string Day = DateTime.Now.Day.ToString();
                    if (Day.Length < 2)
                    {
                        Day = "0" + Day;
                    }
                    string Month = DateTime.Now.Month.ToString();
                    if (Month.Length < 2)
                    {
                        Month = "0" + Month;
                    }
                    array.Add(Day + "." + Month + "." + DateTime.Now.Year.ToString());
                }
                else
                {
                    array.Add(table.table.Rows[0][0].ToString());
                }
                array.Add(table.table.Rows[0][1].ToString());
                array.Add(tbTypeID.Text);
                Procedure_Class procedure = new Procedure_Class();
                procedure.procedure_Execution("Product_Update", array);
                tbProductID.Clear();
                tbName.Clear();
                tbPrice.Clear();
                tbTypeID.Clear();
                tbTypeName.Clear();
                tbTerms.Clear();
                ProductFill();
            };

            action.Invoke();
        }
예제 #13
0
        private void BtInsert_Click(object sender, RoutedEventArgs e)
        {
            Action action = () =>
            {
                foreach (DataRow row in sell.Rows)
                {
                    ArrayList array = new ArrayList();
                    array.Add(CurCheck);
                    array.Add(row[2]);
                    array.Add(App.intID);
                    array.Add(row[0]);
                    Procedure_Class procedure = new Procedure_Class();
                    procedure.procedure_Execution("Sell_Insert", array);
                    array.Clear();
                }
                Owner.Show();
                (Owner as SaleInterface).TableRefresh();
                this.Hide();
            };

            action.Invoke();
        }