/// <summary> /// Initializes '_proxy', fills the listboxes. /// </summary> /// <param name="tmp">Host.</param> /// <param name="userId">Id of user.</param> public AddBook(EngServRef.EngServiceClient tmp, int?userId) : this() { _proxy = tmp; user = userId; FillAuthors(); FillCategories(); }
/// <summary> /// 'Edit' form. Hides rating, fills fields. /// </summary> /// <param name="tmp">Host.</param> /// <param name="id">Books id.</param> /// <param name="name">Books name.</param> /// <param name="description">Books description.</param> /// <param name="year">Year (if given).</param> /// <param name="path">Books path.</param> /// <param name="isAbsolute">Is path absolute?</param> /// <param name="cat">Books categories.</param> /// <param name="auth">Books authors.</param> /// <param name="img">Poster.</param> public AddBook(EngServRef.EngServiceClient tmp, int id, string name, string description, int?year, string path, bool isAbsolute, List <int> cat, List <int> auth, string img) : this() { _proxy = tmp; bookId = id; txtName.Text = this.name = name; txtDesc.Text = desc = description; txtPath.Text = this.path = path; this.year = year; if (year != null) { txtYear.Text = year.ToString(); } this.isAbsolute = isAbsolute; chCopy.IsChecked = !this.isAbsolute; imgPath = img; if (imgPath == "WolfB.png") { FormData.SetImage("pack://*****:*****@"Temp\BookImages\{imgPath}")) { FormData.SetImage($@"pack://siteoforigin:,,,/Temp\BookImages\{imgPath}", imDrag); } else { MessageBox.Show("Image can not be found!", "Something went wrong", MessageBoxButton.OK, MessageBoxImage.Error); } } lPath.Content = "..."; categories = cat; authors = auth; stRating.Visibility = Visibility.Collapsed; FillAuthors(auth); FillCategories(cat); }
//Initialize '_proxy' and fields. public AddAuthor(EngServRef.EngServiceClient tmp, int authId) : this(tmp) { id = authId; txtName.Text = _proxy.GetItemProperty(authId, EngServRef.ServerData.Author, EngServRef.PropertyData.Name); txtSurname.Text = _proxy.GetItemProperty(authId, EngServRef.ServerData.Author, EngServRef.PropertyData.Surname); }
//Initialize '_proxy'. public AddAuthor(EngServRef.EngServiceClient tmp) : this() { _proxy = tmp; }