public override long SaveParagraph(ParagraphMap pMap) { var paraOper = new ParagraphOperator(pMap, pMap.ParagraphID == -1 ? OpersDB.odInsert : OpersDB.odUpdate); paraOper.Execute(); return(paraOper.ParagraphID); }
public override void DelParagraphDB(long pg_id) { var pMap = new ParagraphMap(pg_id); var paraOper = new ParagraphOperator(pMap, OpersDB.odDelete); paraOper.Execute(); }
public CommandSaveParagraph(long ParagraphID, long DocID, List <SentenceMap> sentlist) { this.ParagraphID = ParagraphID; this.DocID = DocID; this.sentlist.AddRange(sentlist); pMap = new ParagraphMap(ParagraphID, DocID); }
public override List <SentenceMap> ReadParagraphDB(long pg_id) { var pMap = new ParagraphMap(pg_id); var paraOper = new ParagraphOperator(pMap, OpersDB.odSelect); paraOper.Execute(); return(paraOper.GetSentList()); }
public void SendParagraph(ParagraphMap parastr) { this.parastr = parastr; var builder = SetReq(); var buf = builder.SizedByteArray(); replay = SendMess(new ZFrame(buf)); this.parastr = null; }
public override List <SimpleParam> SaveParagraphBD(ParagraphMap pMap) { courier.servType = TMorph.Schema.ServType.svSUBD; courier.command = TMorph.Schema.ComType.SavePara; courier.SendParagraph(pMap); var paramlist = courier.GetParamsList(); return(paramlist); }
public override List <SimpleParam> SaveParagraphBD(ParagraphMap pMap) { var ParagraphID = dbServer.SaveParagraph(pMap); var paramlist = new List <SimpleParam>(); var param = new SimpleParam(); param.Name = "ParagraphID"; param.Value = ParagraphID.ToString(); paramlist.Add(param); return(paramlist); }
public ParagraphOperator(ParagraphMap pMap, OpersDB operDB) { this.pMap = pMap; this.paragraphID = pMap.ParagraphID; this.docID = pMap.DocumentID; var listSmaps = pMap.GetParagraphSents().Select(x => x.sentstruct).OrderBy(x => x.Order).ToList(); if (listSmaps != null) { this.sentlist.AddRange(listSmaps); } this.sent2Del = pMap.GetDeleted(); if (operDB != OpersDB.odSelect) { indicator.Fill(ParagraphID); } this.Operate = operDB; }
public override void FillDocsParagraphs(ComplexValue list) { DataTable dTable = list.dtable; for (int i = 0; i < dTable.Rows.Count; i++) { var pg_id = dTable.Rows[i].Field <long>("pg_id"); var doc_id = dTable.Rows[i].Field <long>("doc_id"); var created_at = dTable.Rows[i].Field <DateTime?>("created_at"); var ct_id = dTable.Rows[i].Field <long>("ct_id"); var pMap = new ParagraphMap(pg_id, doc_id, created_at, ct_id); var cont = GetContainerByID(ct_id); var doc = cont.GetDocuments().Where(x => x.DocumentID == doc_id).FirstOrDefault(); if (doc != null) { doc.AddParagraph(pMap); } } }
public void SetContext(long contID, long docID, long parID, MorphNode theNode, treeOper tOper) { this.typeOper = tOper; this.contID = contID; this.docID = docID; this.parID = parID; this.theNode = theNode; ParagraphMap pMap = null; switch (tOper) { case (treeOper.toEdit): pMap = store.GetParagraph(contID, docID, parID); break; case (treeOper.toAdd): pMap = new ParagraphMap(-1, docID); break; } this.paraMap = new ParagraphMap(pMap); }
public override long SaveParagraph(ParagraphMap pMap) { long ParagraphID = -1; courier.servType = TMorph.Schema.ServType.svSUBD; courier.command = TMorph.Schema.ComType.SavePara; courier.SendParagraph(pMap); var paramlist = courier.GetParamsList(); if (paramlist == null) { foreach (var par in paramlist) { if (par.Name == "ParagraphID") { ParagraphID = Convert.ToInt32(par.Value, 10); break; } } } return(ParagraphID); }