コード例 #1
0
        private void bt_create_arr_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                //Команда добавления
                FbCommand sqlforin = new FbCommand("IUD_ROLES", con.preh.fb);
                sqlforin.CommandType = System.Data.CommandType.StoredProcedure;
                sqlforin.Parameters.Add("@FLAG", FbDbType.Char).Value    = "I";
                sqlforin.Parameters.Add("@ID", FbDbType.Integer).Value   = null;
                sqlforin.Parameters.Add("@ID_NAME", FbDbType.Date).Value = name.Text;



                sqlforin.ExecuteNonQuery();



                this.Close();
                con.grid_roles.ItemsSource = con.dt_grid_roles();
                con.prop_grid_roles(con.grid_roles);
                System.Windows.MessageBox.Show("Запись успешно добавлена!");
            }


            catch
            {
                System.Windows.MessageBox.Show("Не все поля заполнены или заполненны некорректно!");
            }
        }
コード例 #2
0
        private void bt_create_arr_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                //Команда добавления
                FbCommand sqlforin = new FbCommand("IUD_USERS", con.preh.fb);
                sqlforin.CommandType = System.Data.CommandType.StoredProcedure;
                sqlforin.Parameters.Add("@FLAG", FbDbType.Char).Value        = "I";
                sqlforin.Parameters.Add("@ID", FbDbType.Integer).Value       = null;
                sqlforin.Parameters.Add("@ID_ROLE", FbDbType.Date).Value     = con.grid_roles.GetFocusedRowCellValue("ID").ToString();
                sqlforin.Parameters.Add("@NAME_RES", FbDbType.VarChar).Value = cb_emp.Text;
                sqlforin.Parameters.Add("@PAS", FbDbType.Integer).Value      = pas.Text;


                //FbDataReader reader_ret_id = sqlforin.ExecuteReader();
                //DataTable dt_ret_id = new DataTable();
                //dt_ret_id.Load(reader_ret_id);
                //con.return_id_doc = dt_ret_id.Rows[0][0].ToString();
                sqlforin.ExecuteNonQuery();



                //dp_cr_date_arr.Text =DateTime.Today.ToString();
                //cb_prov.Clear();
                //comment_arr.Clear();
                this.Close();
                con.grid_roles.ItemsSource = con.dt_grid_roles();
                con.prop_grid_roles(con.grid_roles);
                System.Windows.MessageBox.Show("Запись успешно добавлена!");
                //add_details_arr open_add_det = new add_details_arr();
                //open_add_det.con1 = this;

                //open_add_det.ShowDialog();
            }


            catch
            {
                System.Windows.MessageBox.Show("Не все поля заполнены или заполненны некорректно!");
            }
        }
コード例 #3
0
        private void bt_apply_Click(object sender, RoutedEventArgs e)
        {
            if (chnom.IsChecked == true)
            {
                fnom = "1";
            }
            else
            {
                fnom = "0";
            }

            if (chmes.IsChecked == true)
            {
                fmes = "1";
            }
            else
            {
                fmes = "0";
            }

            if (chobj.IsChecked == true)
            {
                fobj = "1";
            }
            else
            {
                fobj = "0";
            }

            if (chcontr.IsChecked == true)
            {
                fcontr = "1";
            }
            else
            {
                fcontr = "0";
            }

            if (chemp.IsChecked == true)
            {
                femp = "1";
            }
            else
            {
                femp = "0";
            }

            if (chwar.IsChecked == true)
            {
                fwar = "1";
            }
            else
            {
                fwar = "0";
            }

            if (chchar.IsChecked == true)
            {
                fchar = "1";
            }
            else
            {
                fchar = "0";
            }

            if (charr.IsChecked == true)
            {
                farr = "1";
            }
            else
            {
                farr = "0";
            }

            if (chleave.IsChecked == true)
            {
                fleave = "1";
            }
            else
            {
                fleave = "0";
            }

            if (chmove.IsChecked == true)
            {
                fmove = "1";
            }
            else
            {
                fmove = "0";
            }

            try
            {
                //Команда обновления
                FbCommand sqlforin = new FbCommand("CHANGE_ITEM_ALLOW", con.preh.fb);
                sqlforin.CommandType = System.Data.CommandType.StoredProcedure;
                sqlforin.Parameters.Add("@ID_ROLE", FbDbType.Integer).Value  = con.grid_roles.GetFocusedRowCellValue("ID").ToString();
                sqlforin.Parameters.Add("@ALLOW_NOM", FbDbType.Char).Value   = fnom;
                sqlforin.Parameters.Add("@ALLOW_MES", FbDbType.Char).Value   = fmes;
                sqlforin.Parameters.Add("@ALLOW_CHAR", FbDbType.Char).Value  = fchar;
                sqlforin.Parameters.Add("@ALLOW_CON", FbDbType.Char).Value   = fcontr;
                sqlforin.Parameters.Add("@ALLOW_OBJ", FbDbType.Char).Value   = fobj;
                sqlforin.Parameters.Add("@ALLOW_EMP", FbDbType.Char).Value   = femp;
                sqlforin.Parameters.Add("@ALLOW_WAR", FbDbType.Char).Value   = fwar;
                sqlforin.Parameters.Add("@ALLOW_ARR", FbDbType.Char).Value   = farr;
                sqlforin.Parameters.Add("@ALLOW_LEAVE", FbDbType.Char).Value = fleave;
                sqlforin.Parameters.Add("@ALLOW_MOVE", FbDbType.Char).Value  = fmove;



                sqlforin.ExecuteNonQuery();



                this.Close();
                con.grid_roles.ItemsSource = con.dt_grid_roles();
                con.prop_grid_roles(con.grid_roles);
                System.Windows.MessageBox.Show("Изменения успешно применены!");
            }


            catch
            {
                System.Windows.MessageBox.Show("Невозможно применить изменения. Проверьте подключение к базе!");
            }
        }