Ejemplo n.º 1
0
        public Documentation AddProcessDoc(Documentation pdoc)
        {
            Documentation retval = null;

            using (SystemMapEntities db = new SystemMapEntities())
            {
                process_docs ndoc = new process_docs {
                    name = pdoc.name, doctypeid = pdoc.docTypeId, descr = pdoc.description, docurl = pdoc.url, processid = pdoc.componentId
                };
                db.process_docs.Add(ndoc);
                db.SaveChanges();
                retval = new Documentation
                {
                    documentationId = ndoc.process_docid,
                    name            = ndoc.name,
                    description     = ndoc.descr,
                    url             = ndoc.docurl,
                    docTypeId       = ndoc.doctypeid,
                    documentType    = new DocType
                    {
                        typeId      = ndoc.doctypeid,
                        name        = ndoc.doc_type.typename,
                        description = ndoc.doc_type.descr,
                        iconUrl     = ndoc.doc_type.iconurl
                    }
                };
            }
            return(retval);
        }
Ejemplo n.º 2
0
 public void DeleteProcessDoc(int pdocid)
 {
     using (SystemMapEntities db = new SystemMapEntities())
     {
         process_docs delrec = db.process_docs.Where(d => d.process_docid == pdocid).SingleOrDefault();
         if (delrec != null)
         {
             db.process_docs.Remove(delrec);
             db.SaveChanges();
         }
     }
 }
Ejemplo n.º 3
0
 public void UpdateProcessDoc(Documentation udata)
 {
     using (SystemMapEntities db = new SystemMapEntities())
     {
         process_docs urec = db.process_docs.Where(d => d.process_docid == udata.documentationId).SingleOrDefault();
         if (urec != null)
         {
             urec.name      = udata.name;
             urec.descr     = udata.description;
             urec.docurl    = udata.url;
             urec.doctypeid = udata.docTypeId;
             db.SaveChanges();
         }
     }
 }