public string childCreate(string name, string parent) { if (name == null || name.Length <= 0) { return("nameNull"); } //if (creator == null || creator.Length <= 0) return "creatorNull"; if (parent == null || parent.Length <= 0) { return("parentNull"); } string response = "controllerError"; Guid childGuid = Guid.NewGuid(); try { IchildClient create = new IchildClient(); response = create.createString(parent, name, Guid.NewGuid().ToString()); try { response = new Guid(response).ToString(); } catch (Exception ex) { return(ex.ToString()); } } catch (Exception ex) { return("ErrorUI : " + ex.ToString());; } return(response); }
public childOptions readChildOptions(string childId) { IchildClient child = new IchildClient(); childOptions response = new childOptions(); response = child.readOptions(new Guid(childId), Guid.NewGuid()); return(response); }
public List <childReference.childClass> fetchChild(string course, string parent) { List <childReference.childClass> response = new List <childReference.childClass> (); IchildClient read = new IchildClient(); try { response = read.readString(course, parent).ToList(); } catch { } return(response); }
public string updateChildOptions(string child, string user, string releaseDate, string releaseDates) { string response = ""; IchildClient client = new IchildClient(); childOptions options = new childOptions(); options.childId = new Guid(child); options.user = new Guid(user); options.releaseDate = DateTime.Parse(releaseDate); options.releaseDates = Convert.ToInt32(releaseDates.Length <= 0 || releaseDates == null ? "0" : releaseDates); //response = client.updateOptions(options); return(response); }
public string child(string childId) { string response = "Success"; try { IchildClient use = new IchildClient(); // Script for deleting child response = use.deleteString(childId, new Guid().ToString()); } catch (Exception ex) { response = ex.ToString(); } return(response); }
public string childCreate(string name, string creator, string parent) { if (name == null || name.Length <= 0) { return("nameNull"); } if (creator == null || creator.Length <= 0) { return("creatorNull"); } if (parent == null || parent.Length <= 0) { return("parentNull"); } string response = ""; Guid childGuid = Guid.NewGuid(); try { IchildClient create = new IchildClient(); response = create.createString(parent, name, creator); try { childGuid = new Guid(response); } catch { return(response); } } catch { return("ErrorMachine"); } return(response); }
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); }