Beispiel #1
0
        public string deleteAllString(string courseId, string user)
        {
            string response = "";

            try
            {
                parentDeleteAll del = new parentDeleteAll();
                del.courseId = new Guid(courseId);
                del.user     = new Guid(user);
                response     = deleteAll(del);
            }
            catch
            {
                response = "Error";
            }

            return(response);
        }
Beispiel #2
0
        public string deleteAll(parentDeleteAll use)
        {
            string response = "";

            SqlConnection con = new SqlConnection(data);
            SqlCommand    cmd = new SqlCommand("DELETE FROM courseParent WHERE courseId = @courseId", con);

            cmd.Parameters.AddWithValue("@courseId", use.courseId);

            con.Open();
            try
            {
                cmd.ExecuteNonQuery();
                response = "Success";
            }
            catch
            {
                response = "Error";
            }
            con.Close();

            return(response);
        }