예제 #1
0
        public override long SaveParagraph(ParagraphMap pMap)
        {
            var paraOper = new ParagraphOperator(pMap, pMap.ParagraphID == -1 ? OpersDB.odInsert : OpersDB.odUpdate);

            paraOper.Execute();
            return(paraOper.ParagraphID);
        }
예제 #2
0
        public override void DelParagraphDB(long pg_id)
        {
            var pMap     = new ParagraphMap(pg_id);
            var paraOper = new ParagraphOperator(pMap, OpersDB.odDelete);

            paraOper.Execute();
        }
예제 #3
0
        public CommandSaveParagraph(long ParagraphID, long DocID, List <SentenceMap> sentlist)
        {
            this.ParagraphID = ParagraphID;
            this.DocID       = DocID;
            this.sentlist.AddRange(sentlist);

            pMap = new ParagraphMap(ParagraphID, DocID);
        }
예제 #4
0
        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());
        }
예제 #5
0
파일: Courier.cs 프로젝트: Veivan/MorphApp
        public void SendParagraph(ParagraphMap parastr)
        {
            this.parastr = parastr;
            var builder = SetReq();
            var buf     = builder.SizedByteArray();

            replay       = SendMess(new ZFrame(buf));
            this.parastr = null;
        }
예제 #6
0
        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);
        }
예제 #7
0
        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);
        }
예제 #8
0
        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;
        }
예제 #9
0
        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);
                }
            }
        }
예제 #10
0
        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);
        }
예제 #11
0
        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);
        }