public int getIntByQueryParameter(string query, string Column, int Count, ParameterBack p)
        {
            int name = 0; string Variable = "@Parameter";

            using (SqlConnection con = new SqlConnection(connectionString))
            {
                using (SqlCommand cmd = new SqlCommand(query, con))
                {
                    for (int i = 1; i <= Count; i++)
                    {
                        cmd.Parameters.AddWithValue(Variable + i, p.getParameter(i));
                    }
                    using (SqlDataAdapter sda = new SqlDataAdapter())
                    {
                        cmd.Connection    = con;
                        sda.SelectCommand = cmd;
                        using (dt = new DataTable())
                        {
                            sda.Fill(dt);
                        }
                    }
                }
            }
            foreach (DataRow row in dt.Rows)
            {
                name = Convert.ToInt32(row[Column]);
            }
            return(name);
        }
        public Boolean CheckByQueryParameter(string query, int Count, ParameterBack p)
        {
            string  Variable = "@Parameter";
            Boolean name     = false;

            using (SqlConnection connection = new SqlConnection(connectionString))
            {
                connection.Open();
                using (SqlCommand command = new SqlCommand(query, connection))
                {
                    for (int i = 1; i <= Count; i++)
                    {
                        command.Parameters.AddWithValue(Variable + i, p.getParameter(i));
                    }
                    SqlDataReader reader = command.ExecuteReader();
                    while (reader.Read())
                    {
                        if (reader["ID"] != DBNull.Value)
                        {
                            name = true;
                        }
                    }
                }
            }
            return(name);
        }
        public void ChangeByQueryParameter(string query, int Count, ParameterBack p)
        {
            string Variable = "@Parameter";

            using (SqlConnection con = new SqlConnection(connectionString))
            {
                using (SqlCommand cmd = new SqlCommand(query, con))
                {
                    con.Open();
                    for (int i = 1; i <= Count; i++)
                    {
                        cmd.Parameters.AddWithValue(Variable + i, p.getParameter(i));
                    }
                    cmd.ExecuteNonQuery();
                    con.Close();
                }
            }
        }