protected override void OnPreRender(EventArgs e) { if (yariMediaKeywordID != 0) { yariMediaKeyword = new YariMediaKeyword(yariMediaKeywordID); #region Bind Default Folder // // Set Field Entries // ltKeyword.Text = yariMediaKeyword.Keyword.ToString(); #endregion #region Bind _system Folder // // Set Field Entries // #endregion text = "View - " + yariMediaKeyword.ToString(); } }
protected void ok_Click(object sender, EventArgs e) { if (yariMediaKeywordID == 0) { obj = new YariMediaKeyword(); } else { obj = new YariMediaKeyword(yariMediaKeywordID); } obj.Keyword = tbKeyword.Text; if (editOnAdd) { yariMediaKeywordID = obj.Save(); } else { obj.Save(); } if (resetOnAdd) { tbKeyword.Text = string.Empty; } OnUpdated(EventArgs.Empty); }
protected void btOk_Click(object sender, EventArgs e) { YariMediaKeyword yariMediaKeyword = new YariMediaKeyword(yariMediaKeywordID); yariMediaKeyword.Delete(); yariMediaKeywordID = 0; OnDeleted(EventArgs.Empty); }
protected override void OnPreRender(EventArgs e) { if (yariMediaKeywordID != 0) { yariMediaKeyword = new YariMediaKeyword(yariMediaKeywordID); text = "Delete - " + yariMediaKeyword.ToString(); } else { text = "Delete "; } EnsureWindowScripts(); }
protected override void OnPreRender(EventArgs e) { if (yariMediaKeywordID != 0 & loadFlag) { editYariMediaKeyword = new YariMediaKeyword(yariMediaKeywordID); // // Set Field Entries // tbKeyword.Text = editYariMediaKeyword.Keyword; Text = "Edit - " + editYariMediaKeyword.ToString(); } else { Text = "Add "; } }
protected override void OnPreRender(EventArgs e) { if (loadFlag) { if (yariMediaKeywordID > 0) { obj = new YariMediaKeyword(yariMediaKeywordID); text = "Edit - " + obj.ToString(); } else if (yariMediaKeywordID <= 0) { obj = new YariMediaKeyword(); text = "Add "; } // // Set Field Entries // tbKeyword.Text = obj.Keyword; } }
protected void ok_Click(object sender, EventArgs e) { if (yariMediaRecordID == 0) { editYariMediaRecord = new YariMediaRecord(); } else { editYariMediaRecord = new YariMediaRecord(yariMediaRecordID); } editYariMediaRecord.EndNoteReferenceID = int.Parse(tbEndNoteReferenceID.Text); editYariMediaRecord.PublishYear = int.Parse(tbPublishYear.Text); editYariMediaRecord.Title = tbTitle.Text; editYariMediaRecord.Pages = int.Parse(tbPages.Text); editYariMediaRecord.Edition = tbEdition.Text; editYariMediaRecord.Isbn = tbIsbn.Text; editYariMediaRecord.Label = tbLabel.Text; editYariMediaRecord.AbstractText = ftbAbstractText.ContentHTML; editYariMediaRecord.ContentsText = ftbContentsText.ContentHTML; editYariMediaRecord.NotesText = tbNotesText.Text; editYariMediaRecord.AmazonFillDate = deAmazonFillDate.Date; editYariMediaRecord.AmazonRefreshDate = deAmazonRefreshDate.Date; editYariMediaRecord.ImageUrlSmall = tbImageUrlSmall.Text; editYariMediaRecord.ImageUrlMedium = tbImageUrlMedium.Text; editYariMediaRecord.ImageUrlLarge = tbImageUrlLarge.Text; editYariMediaRecord.AbstractEnabled = cbAbstractEnabled.Checked; editYariMediaRecord.ContentsEnabled = cbContentsEnabled.Checked; editYariMediaRecord.NotesEnabled = cbNotesEnabled.Checked; editYariMediaRecord.Authors = tbAuthors.Text; editYariMediaRecord.SecondaryAuthors = tbSecondaryAuthors.Text; editYariMediaRecord.Publisher = tbPublisher.Text; if (msMediaType.SelectedItem != null) { editYariMediaRecord.MediaType = YariMediaType.NewPlaceHolder( int.Parse(msMediaType.SelectedItem.Value)); } else { editYariMediaRecord.MediaType = null; } if (msKeywords.IsChanged) { editYariMediaRecord.Keywords = new YariMediaKeywordCollection(); foreach (ListItem i in msKeywords.Items) { if (i.Selected) { editYariMediaRecord.Keywords.Add(YariMediaKeyword.NewPlaceHolder(int.Parse(i.Value))); } } } if (editOnAdd) { yariMediaRecordID = editYariMediaRecord.Save(); } else { editYariMediaRecord.Save(); } if (resetOnAdd) { tbEndNoteReferenceID.Text = string.Empty; tbPublishYear.Text = string.Empty; tbTitle.Text = string.Empty; tbPages.Text = string.Empty; tbEdition.Text = string.Empty; tbIsbn.Text = string.Empty; tbLabel.Text = string.Empty; ftbAbstractText.ContentHTML = string.Empty; ftbContentsText.ContentHTML = string.Empty; tbNotesText.Text = string.Empty; deAmazonFillDate.Date = DateTime.Now; deAmazonRefreshDate.Date = DateTime.Now; tbImageUrlSmall.Text = string.Empty; tbImageUrlMedium.Text = string.Empty; tbImageUrlLarge.Text = string.Empty; cbAbstractEnabled.Checked = false; cbContentsEnabled.Checked = false; cbNotesEnabled.Checked = false; tbAuthors.Text = string.Empty; tbSecondaryAuthors.Text = string.Empty; tbPublisher.Text = string.Empty; msMediaType.SelectedIndex = 0; } OnUpdated(EventArgs.Empty); }
private void fill() { //Create Instance of Proxy Class AmazonSearchService as1 = new AmazonSearchService(); ProductInfo pi; // while(accessTime > DateTime.Now); //Call Service and Get Product Info try { pi = as1.AsinSearchRequest(GenerateAsinRequest("heavy")); } catch (Exception e) { r.amazonReleaseDate = DateTime.MinValue; r.AmazonRefreshDate = DateTime.Now; r.amazonFillDate = DateTime.MinValue; r.AmazonAvailability = e.Message; return; } finally { lastAccessTime = DateTime.Now; } if (pi.Details[0].Asin == null) { return; } if (pi.Details[0].ProductName != null && pi.Details[0].ProductName != string.Empty) { r.Title = pi.Details[0].ProductName; } r.ImageUrlLarge = pi.Details[0].ImageUrlLarge; r.ImageUrlMedium = pi.Details[0].ImageUrlMedium; r.ImageUrlSmall = pi.Details[0].ImageUrlSmall; try { r.AmazonListPrice = decimal.Parse(pi.Details[0].ListPrice); } catch { } try { r.AmazonOurPrice = decimal.Parse(pi.Details[0].OurPrice); } catch { } r.AmazonFillDate = DateTime.Now; r.AmazonRefreshDate = DateTime.Now; if (pi.Details[0].Media != null) { r.AmazonMedia = pi.Details[0].Media; } else { r.AmazonMedia = null; } try { r.AmazonReleaseDate = DateTime.Parse(pi.Details[0].ReleaseDate); r.PublishYear = r.AmazonReleaseDate.Year; } catch { } KeyPhrase[] amazonKeyPhrases = pi.Details[0].KeyPhrases; if (amazonKeyPhrases != null) { bool addKeyword; for (int x = 0; x < amazonKeyPhrases.Length; x++) { addKeyword = true; for (int y = 0; y < r.Keywords.Count; y++) { if (amazonKeyPhrases[x].KeyPhrase1 == r.Keywords[y].Keyword) { addKeyword = false; break; } } if (!addKeyword) { continue; } YariMediaKeyword k = new YariMediaKeyword(); k.Keyword = amazonKeyPhrases[x].KeyPhrase1; r.Keywords.Add(k); } } if (pi.Details[0].Availability != null) { r.AmazonAvailability = pi.Details[0].Availability; } else { r.AmazonAvailability = string.Empty; } r.AmazonAsin = pi.Details[0].Asin; GreyFox.People.GreyFoxContactManager pM = new Amns.GreyFox.People.GreyFoxContactManager("kitYari_Publishers"); GreyFox.People.GreyFoxContactManager aM = new Amns.GreyFox.People.GreyFoxContactManager("kitYari_Authors"); if (pi.Details[0].Manufacturer != null) { r.Publisher = pi.Details[0].Manufacturer; } else if (pi.Details[0].Publisher != null) { r.Publisher = pi.Details[0].Publisher; } r.Authors = string.Empty; if (pi.Details[0].Authors != null) { for (int x = 0; x < pi.Details[0].Authors.Length; x++) { if (r.Authors.Length > 0) { r.Authors += "; " + pi.Details[0].Authors[x].Trim(); } else { r.Authors = pi.Details[0].Authors[x].Trim(); } } } r.Save(); }