internal BJBookInfo GetBookInfoByPIN(int pin) { DataTable table = dbWrapper.GetBJRecord(pin); BJBookInfo result = new BJBookInfo(); result.Id = $"{Fund}_{pin}"; result.ID = pin; result.Fund = Fund; //BJExemplarInfo exemplar = new BJExemplarInfo(0); int CurrentIdData = 0; foreach (DataRow row in table.Rows) { if ((int)row["IDBLOCK"] != 260) { if ((int)row["IDBLOCK"] == 270)//если есть гиперссылка { result.DigitalCopy = new BJElectronicExemplarInfo(pin, Fund); } else { result.Fields.AddField(row["PLAIN"].ToString(), (int)row["MNFIELD"], row["MSFIELD"].ToString()); } } else { if (CurrentIdData != (int)row["IDDATA"]) { CurrentIdData = (int)row["IDDATA"]; result.Exemplars.Add(BJExemplarInfo.GetExemplarByIdData(CurrentIdData, Fund)); //exemplar = new BJExemplarInfo((int)row["IDDATA"]); //exemplar.Fields.AddField(row["PLAIN"].ToString(), (int)row["MNFIELD"], row["MSFIELD"].ToString()); } else { //exemplar.Fields.AddField(row["PLAIN"].ToString(), (int)row["MNFIELD"], row["MSFIELD"].ToString()); } } } table = dbWrapper.GetRTF(pin); if (table.Rows.Count != 0) { RichTextBox rtb = new RichTextBox(); rtb.Rtf = table.Rows[0][0].ToString(); result.RTF = rtb.Text; rtb.Dispose(); } return(result); }