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

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

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

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

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

            con.Open();
            try
            {
                cmd.ExecuteNonQuery();
                response = "Success";
            }
            catch (Exception ex)
            {
                response = ex.ToString();
                con.Close();
                return(response);
            }
            con.Close();

            try
            {
                childReference.childDeleteAll del = new childReference.childDeleteAll();
                del.parentId = use.parentId;
                del.user     = use.user;
                IchildClient child = new IchildClient();
                response = child.deleteAll(del);
            }
            catch (Exception ex)
            {
                response = ex.ToString();
            }

            return(response);
        }