/// <summary> /// Update values in TitleItem. Returns an object of type TitleItem. /// </summary> /// <param name="sqlConnection">Sql connection or null.</param> /// <param name="sqlTransaction">Sql transaction or null.</param> /// <param name="value">Object of type TitleItem.</param> /// <returns>Object of type TitleItem.</returns> public TitleItem TitleItemUpdateAuto( SqlConnection sqlConnection, SqlTransaction sqlTransaction, TitleItem value) { return(TitleItemUpdateAuto(sqlConnection, sqlTransaction, "BHL", value)); }
public void Create() { dataList = Utils.FromJson <List <FoldData> >(ApiDataList.ApiDataListStr); for (int i = 0; i < dataList.Count; i++) { // 创建标题 TitleItem title = Instantiate(titleItem).GetComponent <TitleItem>(); title.SetTitle(dataList[i].managerName); title.transform.SetParent(this.transform); // 创建子折叠面板 GameObject panel = Instantiate(panelItem); panel.transform.SetParent(this.transform); // 570是折叠页的宽度,30DataItem的高度 // panel.GetComponent<RectTransform>().sizeDelta = new Vector3(570, 70 * dataList[i].apis.Count); title.SetFoldPanel(panel); panel.SetActive(false); // 创建折叠页数据 for (int j = 0; j < dataList[i].apis.Count; j++) { DataItem item = Instantiate(dataItem).GetComponent <DataItem>(); item.transform.SetParent(panel.transform); item.SetInfo(dataList[i].apis[j]); } } }
/// <summary> /// Select values from TitleItem by primary key(s). /// </summary> /// <param name="sqlConnection">Sql connection or null.</param> /// <param name="sqlTransaction">Sql transaction or null.</param> /// <param name="connectionKeyName">Connection key name located in config file.</param> /// <param name="titleItemID"></param> /// <returns>Object of type TitleItem.</returns> public TitleItem TitleItemSelectAuto( SqlConnection sqlConnection, SqlTransaction sqlTransaction, string connectionKeyName, int titleItemID) { SqlConnection connection = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings(connectionKeyName), sqlConnection); SqlTransaction transaction = sqlTransaction; using (SqlCommand command = CustomSqlHelper.CreateCommand("TitleItemSelectAuto", connection, transaction, CustomSqlHelper.CreateInputParameter("TitleItemID", SqlDbType.Int, null, false, titleItemID))) { using (CustomSqlHelper <TitleItem> helper = new CustomSqlHelper <TitleItem>()) { CustomGenericList <TitleItem> list = helper.ExecuteReader(command); if (list.Count > 0) { TitleItem o = list[0]; list = null; return(o); } else { return(null); } } } }
private static void AddTitle(TitleItem titleItem, List <ILine> lines, string id, int level) { if (titleItem != null) { lines.AddRange(titleItem.TitleData.Select(title => title.ToString().ToHeaderLine(id, level))); } }
/// <summary> /// Manage TitleItem object. /// If the object is of type CustomObjectBase, /// then either insert values into, delete values from, or update values in TitleItem. /// </summary> /// <param name="sqlConnection">Sql connection or null.</param> /// <param name="sqlTransaction">Sql transaction or null.</param> /// <param name="value">Object of type TitleItem.</param> /// <returns>Object of type CustomDataAccessStatus<TitleItem>.</returns> public CustomDataAccessStatus <TitleItem> TitleItemManageAuto( SqlConnection sqlConnection, SqlTransaction sqlTransaction, TitleItem value) { return(TitleItemManageAuto(sqlConnection, sqlTransaction, "BHL", value)); }
/// <summary> /// Converts FB2 Title object to XHTML Title /// </summary> /// <param name="titleItem">title item to convert</param> /// <param name="titleConverterParams"></param> /// <returns></returns> public Div Convert(TitleItem titleItem, TitleConverterParamsV2 titleConverterParams) { if (titleItem == null) { throw new ArgumentNullException("titleItem"); } _level = titleConverterParams.TitleLevel; var title = new Div(HTMLElementType.XHTML11); foreach (var fb2TextItem in titleItem.TitleData) { if (fb2TextItem is ParagraphItem) { var paragraphStyle = GetParagraphStyleByLevel(_level); var paragraphConverter = new ParagraphConverterV2(); title.Add(paragraphConverter.Convert(fb2TextItem as ParagraphItem, new ParagraphConverterParamsV2 { ResultType = paragraphStyle, Settings = titleConverterParams.Settings, StartSection = false })); } else if (fb2TextItem is EmptyLineItem) { var emptyLineConverter = new EmptyLineConverterV2(); title.Add(emptyLineConverter.Convert()); } else { Debug.WriteLine("invalid type in Title - {0}", fb2TextItem.GetType()); } } SetClassType(title, ElementStylesV2.PoemTitle); return(title); }
void TitleUpdate(TitleItem title, ScrollYExtand.DataTemplate data, int index) { title.Text.text = data.Title as string; title.bk.DataContext = data; title.bk.Click = (o, e) => { var dt = o.DataContext as ScrollYExtand.DataTemplate; if (dt.Hide) { view.scroll.OpenSection(dt); if (current != dt) { view.scroll.HideSection(current); } current = dt; } else { view.scroll.HideSection(dt); if (dt == current) { current = null; } } }; }
public ActionResult UpdateTitleItem(TitleItem info) { int result = TitleItembll.UpdateTitleItem(info); var res = new ConfigurableJsonResult(); res.Data = result; HttpContext.Response.AppendHeader("Access-Control-Allow-Origin", "*"); return(res); }
public ActionResult GetTitleItemId(stId info) { TitleItem result = TitleItembll.GetTitleItem(info.Id); var res = new ConfigurableJsonResult(); res.Data = result; HttpContext.Response.AppendHeader("Access-Control-Allow-Origin", "*"); return(res); }
public ActionResult IsExistTitleItem(TitleItem info) { bool result = TitleItembll.IsExistTitleItem(info); var res = new ConfigurableJsonResult(); res.Data = result == true ? 1 : 0; HttpContext.Response.AppendHeader("Access-Control-Allow-Origin", "*"); return(res); }
protected virtual void AddTitle(TitleItem titleItem) { if (titleItem != null) { foreach (var title in titleItem.TitleData) { BookText.Add(title.ToString()); } } }
/// <summary> /// Insert values into TitleItem. Returns an object of type TitleItem. /// </summary> /// <param name="sqlConnection">Sql connection or null.</param> /// <param name="sqlTransaction">Sql transaction or null.</param> /// <param name="connectionKeyName">Connection key name located in config file.</param> /// <param name="value">Object of type TitleItem.</param> /// <returns>Object of type TitleItem.</returns> public TitleItem TitleItemInsertAuto( SqlConnection sqlConnection, SqlTransaction sqlTransaction, string connectionKeyName, TitleItem value) { return(TitleItemInsertAuto(sqlConnection, sqlTransaction, connectionKeyName, value.TitleID, value.ItemID, value.ItemSequence)); }
protected virtual void AddTitle(TitleItem titleItem) { if (titleItem != null) { foreach (var title in titleItem.TitleData) { _lines.Add(new HeaderLine { Text = title.ToString() }); } } }
/// <summary> /// Manage TitleItem object. /// If the object is of type CustomObjectBase, /// then either insert values into, delete values from, or update values in TitleItem. /// </summary> /// <param name="sqlConnection">Sql connection or null.</param> /// <param name="sqlTransaction">Sql transaction or null.</param> /// <param name="connectionKeyName">Connection key name located in config file.</param> /// <param name="value">Object of type TitleItem.</param> /// <returns>Object of type CustomDataAccessStatus<TitleItem>.</returns> public CustomDataAccessStatus <TitleItem> TitleItemManageAuto( SqlConnection sqlConnection, SqlTransaction sqlTransaction, string connectionKeyName, TitleItem value) { if (value.IsNew && !value.IsDeleted) { TitleItem returnValue = TitleItemInsertAuto(sqlConnection, sqlTransaction, connectionKeyName, value.TitleID, value.ItemID, value.ItemSequence); return(new CustomDataAccessStatus <TitleItem>( CustomDataAccessContext.Insert, true, returnValue)); } else if (!value.IsNew && value.IsDeleted) { if (TitleItemDeleteAuto(sqlConnection, sqlTransaction, connectionKeyName, value.TitleItemID)) { return(new CustomDataAccessStatus <TitleItem>( CustomDataAccessContext.Delete, true, value)); } else { return(new CustomDataAccessStatus <TitleItem>( CustomDataAccessContext.Delete, false, value)); } } else if (value.IsDirty && !value.IsDeleted) { TitleItem returnValue = TitleItemUpdateAuto(sqlConnection, sqlTransaction, connectionKeyName, value.TitleItemID, value.TitleID, value.ItemID, value.ItemSequence); return(new CustomDataAccessStatus <TitleItem>( CustomDataAccessContext.Update, true, returnValue)); } else { return(new CustomDataAccessStatus <TitleItem>( CustomDataAccessContext.NA, false, value)); } }
public int AddTitleItem(TitleItem info) { string strSql = "insert into TitleItem(TitleItemContent,UpdateDateTime) values(@TitleItemContent,@UpdateDateTime)"; return(DBFactory.GetDB(DBType.SQLITE, m_strConn).ExecuteNonQuery(strSql, new DbParameter[] { new SQLiteParameter() { Value = info.UpdateDateTime, ParameterName = "@UpdateDateTime" }, new SQLiteParameter() { Value = info.TitleItemContent, ParameterName = "@TitleItemContent" } })); }
/// <summary> /// 设置主界面当前选中的选项 /// </summary> /// <param name="index"></param> private void SetSelectIndex(int index) { if (_selectIndex != -1) { TitleItem item = _itemList[_selectIndex]; TweenManager.GetInstance().RemoveTweenByGo(item.img.gameObject); item.img.color = new Color(1, 1, 1, 1); } _selectIndex = index; if (_selectIndex != -1) { TitleItem item = _itemList[_selectIndex]; TweenColor tween = TweenManager.GetInstance().Create <TweenColor>(); tween.SetParas(item.img.gameObject, 0, 30, ePlayMode.PingPong); tween.SetParas(new Color(1, 1, 1, 1), new Color(0.5f, 0, 0, 1), InterpolationMode.Linear); TweenManager.GetInstance().AddTween(tween); } }
public bool IsExistTitleItem(TitleItem info) { string strSql = "select 1 from TitleItem where TitleItemContent=@TitleItemContent"; DataTable list = DBFactory.GetDB(DBType.SQLITE, m_strConn).ExecuteStrSql(strSql, new DbParameter[] { new SQLiteParameter() { Value = info.TitleItemContent, ParameterName = "@TitleItemContent" } }); if (list != null && list.Rows.Count > 0) { return(true); } else { return(false); } }
public int UpdateTitleItem(TitleItem info) { string strSql = "update TitleItem set TitleItemContent=@TitleItemContent,UpdateDateTime=@UpdateDateTime where TitleItemId=@TitleItemId"; return(DBFactory.GetDB(DBType.SQLITE, m_strConn).ExecuteNonQuery(strSql, new DbParameter[] { new SQLiteParameter() { Value = info.UpdateDateTime, ParameterName = "@UpdateDateTime" }, new SQLiteParameter() { Value = info.TitleItemId, ParameterName = "@TitleItemId" }, new SQLiteParameter() { Value = info.TitleItemContent, ParameterName = "@TitleItemContent" } })); }
public override void Init(GameObject viewObj) { base.Init(viewObj); // 背景 _bgTf = _viewTf.Find("Bg").GetComponent <RectTransform>(); // 选项Go的名称 _itemCount = _titleItemDataList.Count; _itemList = new List <TitleItem>(); for (int i = 0; i < _itemCount; i++) { TitleItem item = new TitleItem(); RectTransform tf = _viewTf.Find("Container/" + _titleItemDataList[i].goName).GetComponent <RectTransform>(); item.tf = tf; item.go = tf.gameObject; item.img = tf.Find("Img").GetComponent <Image>(); float posY = TitleItemStartPosY + i * TitleItemIntervalY; item.start = new Vector2(TitleItemAppearPosX, posY); item.end = new Vector2(TitleItemStartPosX, posY); _itemList.Add(item); } }
private List <TitleItem> DataTableToList(DataTable dt) { List <TitleItem> list = new List <TitleItem>(); if (dt != null) { foreach (DataRow dr in dt.Rows) { TitleItem info = new TitleItem(); info.TitleItemContent = dr["TitleItemContent"] == DBNull.Value ? "" : dr["TitleItemContent"].ToString(); info.TitleItemId = dr["TitleItemId"] == DBNull.Value ? -100 : Convert.ToInt32(dr["TitleItemId"]); if (dr["UpdateDateTime"] != DBNull.Value) { DateTime datetime; DateTime.TryParse(dr["UpdateDateTime"].ToString(), out datetime); info.UpdateDateTime = datetime; } list.Add(info); } } return(list); }
internal void Load(XElement xPoem) { if (xPoem == null) { throw new ArgumentNullException("xPoem"); } if (xPoem.Name.LocalName != Fb2PoemElementName) { throw new ArgumentException("Element of wrong type passed", "xPoem"); } Title = null; Date = null; epigraphs.Clear(); content.Clear(); authors.Clear(); IEnumerable<XElement> xElements = xPoem.Elements(); foreach (var xElement in xElements) { if (xElement.Name == (XName)(xPoem.Name.Namespace + StanzaItem.Fb2StanzaElementName)) { StanzaItem stanza = new StanzaItem(); try { stanza.Load(xElement); content.Add(stanza); } catch (Exception) { continue; } } else if (xElement.Name == (XName)(xPoem.Name.Namespace + SubTitleItem.Fb2SubtitleElementName)) { SubTitleItem subtitle = new SubTitleItem(); try { subtitle.Load(xElement); content.Add(subtitle); } catch (Exception) { continue; } } else if (xElement.Name == (XName)(xPoem.Name.Namespace + TitleItem.Fb2TitleElementName) && Title == null) // only one title { Title = new TitleItem(); Title.Load(xElement); } else if (xElement.Name == (XName)(xPoem.Name.Namespace + EpigraphItem.Fb2EpigraphElementName)) { EpigraphItem epigraphItem = new EpigraphItem(); try { epigraphItem.Load(xElement); epigraphs.Add(epigraphItem); } catch (Exception) { continue; } } else if (xElement.Name == (XName)(xPoem.Name.Namespace + TextAuthorItem.Fb2TextAuthorElementName)) { TextAuthorItem author = new TextAuthorItem(); try { author.Load(xElement); authors.Add(author); } catch (Exception) { continue; } } else if (xElement.Name == (XName)(xPoem.Name.Namespace + DateItem.Fb2DateElementName) && Date == null) // only one date { Date = new DateItem(); try { Date.Load(xElement); } catch (Exception) { continue; } } } XAttribute xID = xPoem.Attribute("id"); if ((xID != null) && (xID.Value != null)) { ID = xID.Value; } Lang = null; XAttribute xLang = xPoem.Attribute(XNamespace.Xml + "lang"); if ((xLang != null) && (xLang.Value != null)) { Lang = xLang.Value; } }
protected void OnTitleItemGenerated(TitleItem resultItem) { this.TitleItemGenerated?.Invoke(resultItem); }
private void MenuMain_Load(object sender, EventArgs e) { Rectangle rect = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea; //Width = rect.Width; Height = rect.Height - 50; this.Location = new Point(10, 40); TitleItem temp_item = new TitleItem(); temp_item.MainTitle = "订单管理"; temp_item.SubItem.Add("订单"); temp_item.SubItem.Add("打样"); temp_item.SubItem.Add("生产"); temp_item.SubItem.Add("出货记录"); temp_item.SubItem.Add("快递记录"); title.Add(temp_item); temp_item = new TitleItem(); temp_item.MainTitle = "任务管理"; temp_item.SubItem.Add("进度跟踪"); temp_item.SubItem.Add("工作日历"); title.Add(temp_item); temp_item = new TitleItem(); temp_item.MainTitle = "物料管理"; temp_item.SubItem.Add("面料"); temp_item.SubItem.Add("辅料"); temp_item.SubItem.Add("特殊工艺"); title.Add(temp_item); temp_item = new TitleItem(); temp_item.MainTitle = "关系管理"; temp_item.SubItem.Add("客户"); temp_item.SubItem.Add("服装厂"); temp_item.SubItem.Add("其他厂商"); temp_item.SubItem.Add("联系人"); title.Add(temp_item); temp_item = new TitleItem(); temp_item.MainTitle = "文件库"; temp_item.SubItem.Add("文件库"); title.Add(temp_item); button1.Text = "闪动"; button2.Text = "插入[离开]"; button3.Text = "大/小图标"; chatListBox1.Items.Clear(); Random rnd = new Random(); for (int i = 0; i < title.Count; i++) { ChatListItem item = new ChatListItem(title[i].MainTitle); for (int j = 0; j < title[i].SubItem.Count; j++) { ChatListSubItem subItem = new ChatListSubItem("", title[i].SubItem[j], "");//注释说明 subItem.HeadImage = getHeadImage(title[i].SubItem[j]); subItem.Status = (ChatListSubItem.UserStatus)(j % 6); item.SubItems.AddAccordingToStatus(subItem); } item.SubItems.Sort(); chatListBox1.Items.Add(item); } ChatListItem itema = new ChatListItem("TEST"); for (int i = 0; i < 5; i++) { chatListBox1.Items.Add(itema); } chatListBox1.Items.Remove(itema); }
/// <exclude /> public void SetTitle(string title, Size topLeftPadding, Size bottomRightPadding, Color fontColor, string fontFamilyName, float fontSize, FontStyle fontStyle) { _titleItem = new TitleItem(title, topLeftPadding, bottomRightPadding, fontColor, fontFamilyName, fontSize, fontStyle); }
internal void Load(XElement xPoem) { if (xPoem == null) { throw new ArgumentNullException("xPoem"); } if (xPoem.Name.LocalName != Fb2PoemElementName) { throw new ArgumentException("Element of wrong type passed", "xPoem"); } Title = null; Date = null; epigraphs.Clear(); content.Clear(); authors.Clear(); IEnumerable <XElement> xElements = xPoem.Elements(); foreach (var xElement in xElements) { if (xElement.Name == (XName)(xPoem.Name.Namespace + StanzaItem.Fb2StanzaElementName)) { StanzaItem stanza = new StanzaItem(); try { stanza.Load(xElement); content.Add(stanza); } catch (Exception) { continue; } } else if (xElement.Name == (XName)(xPoem.Name.Namespace + SubTitleItem.Fb2SubtitleElementName)) { SubTitleItem subtitle = new SubTitleItem(); try { subtitle.Load(xElement); content.Add(subtitle); } catch (Exception) { continue; } } else if (xElement.Name == (XName)(xPoem.Name.Namespace + TitleItem.Fb2TitleElementName) && Title == null) // only one title { Title = new TitleItem(); Title.Load(xElement); } else if (xElement.Name == (XName)(xPoem.Name.Namespace + EpigraphItem.Fb2EpigraphElementName)) { EpigraphItem epigraphItem = new EpigraphItem(); try { epigraphItem.Load(xElement); epigraphs.Add(epigraphItem); } catch (Exception) { continue; } } else if (xElement.Name == (XName)(xPoem.Name.Namespace + TextAuthorItem.Fb2TextAuthorElementName)) { TextAuthorItem author = new TextAuthorItem(); try { author.Load(xElement); authors.Add(author); } catch (Exception) { continue; } } else if (xElement.Name == (XName)(xPoem.Name.Namespace + DateItem.Fb2DateElementName) && Date == null) // only one date { Date = new DateItem(); try { Date.Load(xElement); } catch (Exception) { continue; } } } XAttribute xID = xPoem.Attribute("id"); if ((xID != null) && (xID.Value != null)) { ID = xID.Value; } Lang = null; XAttribute xLang = xPoem.Attribute(XNamespace.Xml + "lang"); if ((xLang != null) && (xLang.Value != null)) { Lang = xLang.Value; } }
protected override void OnRequestSuccess(object param, string requeststr) { base.OnRequestSuccess(param, requeststr); if (!string.IsNullOrEmpty(requeststr)) { MatchCollection itemmatchs = Regex.Matches(requeststr, this.ItemMatchString, RegexOptions.IgnoreCase | RegexOptions.Multiline); if (itemmatchs.Count > 0) { int first = itemmatchs[0].Value.IndexOf("{"); int last = itemmatchs[0].Value.LastIndexOf(";"); string value = itemmatchs[0].Value.Substring(first, last - first); try { ContentWrapper content = JsonConvert.DeserializeObject <ContentWrapper>(value); if (content != null && content.search != null && content.search.card != null && content.search.card.movie != null) { TitleItem titleItem = new TitleItem { OwnerWebCrawler = this, Title = content.search.card.movie.title, ResourceType = content.search.card.movie.subtype, DetailUrl = "https://www.cilimao.cc/baike/movie/" + content.search.card.movie.encodeId, MovieTitle = content.search.card.movie, }; this.OnTitleItemGenerated(titleItem); } if (content != null && content.search != null && content.search.result != null && content.search.result.content != null && content.search.result.content.Count > 0) { foreach (var item in content.search.result.content) { JObject jobj = item as JObject; if (jobj != null) { ContentItem contentItem = JsonConvert.DeserializeObject <ContentItem>(jobj.ToString()); if (contentItem != null) { ResultItem resultItem = null; if (!string.IsNullOrEmpty(contentItem.shorturl)) { resultItem = new BaiduNetDiskItem { OwnerWebCrawler = this, ResourceType = "未知", Title = contentItem.title, DetailUrl = string.IsNullOrEmpty(contentItem.infohash) ? string.Empty : "https://www.cilimao.cc/information/" + contentItem.infohash, BaiduNetDiskLink = string.IsNullOrEmpty(contentItem.shorturl) ? string.Empty : "https://pan.baidu.com/s/" + contentItem.shorturl, CreateTime = contentItem.created_time, Size = ((double)contentItem.content_size / 1024 / 1024 / 1024).ToString("0.00") + " GB", }; } else { resultItem = new MagnetItem() { OwnerWebCrawler = this, ResourceType = "未知", Title = contentItem.title, DetailUrl = string.IsNullOrEmpty(contentItem.infohash) ? string.Empty : "https://www.cilimao.cc/information/" + contentItem.infohash, MagneticLink = string.IsNullOrEmpty(contentItem.infohash) ? string.Empty : "magnet:?xt=urn:btih:" + contentItem.infohash, CreateTime = contentItem.created_time, Size = ((double)contentItem.content_size / 1024 / 1024 / 1024).ToString("0.00") + " GB", }; } if (!this.CheckItemNeedCollect(resultItem, param as ItemRequestParam)) { continue; } this.OnResultItemGenerated(resultItem); } } } } else { this.IsFinished = true; } } catch (Exception e) { } } else { this.IsFinished = true; } } }
internal void Load(XElement xStanza) { if (xStanza == null) { throw new ArgumentNullException("xStanza"); } if (xStanza.Name.LocalName != Fb2StanzaElementName) { throw new ArgumentException("Element of wrong type passed", "xStanza"); } Title = null; XElement xTitle = xStanza.Element(xStanza.Name.Namespace + TitleItem.Fb2TitleElementName); if (xTitle != null) { Title = new TitleItem(); try { Title.Load(xTitle); } catch (Exception) { } } SubTitle = null; XElement xSubtitle = xStanza.Element(xStanza.Name.Namespace + SubTitleItem.Fb2SubtitleElementName); if (xSubtitle != null) { SubTitle = new SubTitleItem(); try { SubTitle.Load(xSubtitle); } catch (Exception) { } } lines.Clear(); IEnumerable<XElement> xLines = xStanza.Elements(xStanza.Name.Namespace + VPoemParagraph.Fb2VParagraphItemName); foreach (var xLine in xLines) { VPoemParagraph vline = new VPoemParagraph(); try { vline.Load(xLine); lines.Add(vline); } catch (Exception) { continue; } } Lang = null; XAttribute xLang = xStanza.Attribute(XNamespace.Xml + "lang"); if ((xLang != null) && (xLang.Value != null)) { Lang = xLang.Value; } }
internal void Load(XElement xStanza) { if (xStanza == null) { throw new ArgumentNullException(nameof(xStanza)); } if (xStanza.Name.LocalName != Fb2StanzaElementName) { throw new ArgumentException("Element of wrong type passed", nameof(xStanza)); } Title = null; XElement xTitle = xStanza.Element(xStanza.Name.Namespace + TitleItem.Fb2TitleElementName); if (xTitle != null) { Title = new TitleItem(); try { Title.Load(xTitle); } catch (Exception) { // ignored } } SubTitle = null; XElement xSubtitle = xStanza.Element(xStanza.Name.Namespace + SubTitleItem.Fb2SubtitleElementName); if (xSubtitle != null) { SubTitle = new SubTitleItem(); try { SubTitle.Load(xSubtitle); } catch (Exception) { // ignored } } _lines.Clear(); IEnumerable <XElement> xLines = xStanza.Elements(xStanza.Name.Namespace + VPoemParagraph.Fb2VParagraphItemName); foreach (var xLine in xLines) { VPoemParagraph vline = new VPoemParagraph(); try { vline.Load(xLine); _lines.Add(vline); } catch (Exception) { // ignored } } Lang = null; XAttribute xLang = xStanza.Attribute(XNamespace.Xml + "lang"); if (xLang != null && xLang.Value != null) { Lang = xLang.Value; } }
void TailUpdate(TitleItem title, ScrollYExtand.DataTemplate data, int index) { title.Text.Text = data.Tail as string; }
protected void saveButton_Click(object sender, EventArgs e) { Item item = (Item)Session["Item" + itemIdTextBox.Text]; if (validate(item)) { // Gather up data on form short?s = null; int? i = null; item.MARCItemID = marcItemIDTextBox.Text.Trim(); item.CallNumber = callNumberTextBox.Text.Trim(); item.Volume = volumeTextBox.Text.Trim(); item.InstitutionCode = (ddlInst.SelectedValue.Length == 0 ? null : ddlInst.SelectedValue); item.LanguageCode = (ddlLang.SelectedValue.Length == 0 ? null : ddlLang.SelectedValue); item.Note = notesTextBox.Text.Trim(); item.Year = yearTextBox.Text.Trim(); item.IdentifierBib = identifierBibTextBox.Text.Trim(); item.ZQuery = zQueryTextBox.Text.Trim(); item.Sponsor = sponsorTextBox.Text.Trim(); item.LicenseUrl = licenseUrlTextBox.Text.Trim(); item.Rights = rightsTextBox.Text.Trim(); item.DueDiligence = dueDiligenceTextBox.Text.Trim(); item.CopyrightStatus = copyrightStatusTextBox.Text.Trim(); item.CopyrightRegion = copyrightRegionTextBox.Text.Trim(); item.CopyrightComment = copyrightCommentTextBox.Text.Trim(); item.CopyrightEvidence = copyrightEvidenceTextBox.Text.Trim(); item.VaultID = (ddlVault.SelectedIndex == 0 ? i : int.Parse(ddlVault.SelectedValue)); item.ItemStatusID = int.Parse(ddlItemStatus.SelectedValue); item.IsNew = false; //---------------------------------------- // Update the title information CustomGenericList <ItemTitle> itemTitles = (CustomGenericList <ItemTitle>)Session["ItemTitleList" + itemIdTextBox.Text]; // Add new titles foreach (ItemTitle itemTitle in itemTitles) { bool found = false; foreach (TitleItem titleItem in item.TitleItems) { if (itemTitle.TitleID == titleItem.TitleID) { found = true; break; } } if (!found) { TitleItem newTitleItem = new TitleItem(); newTitleItem.TitleID = itemTitle.TitleID; newTitleItem.ItemID = item.ItemID; newTitleItem.ItemSequence = 1; newTitleItem.IsNew = true; item.TitleItems.Add(newTitleItem); } } // Flag deleted titles foreach (TitleItem titleItem in item.TitleItems) { bool found = false; foreach (ItemTitle itemTitle in itemTitles) { if (titleItem.TitleID == itemTitle.TitleID) { found = true; break; } } if (!found) { titleItem.IsDeleted = true; } } //---------------------------------------- BHLProvider bp = new BHLProvider(); try { bp.ItemSave(item, 1); } catch (Exception ex) { Session["Exception"] = ex; Response.Redirect("/Error.aspx"); } } else { return; } litMessage.Text = "<span class='liveData'>Item Saved.</span>"; Page.MaintainScrollPositionOnPostBack = false; //Response.Redirect("/Admin/Dashboard.aspx"); }