Beispiel #1
0
        public ActionResult Create(DocumentDTO DocEntity, CitizenDoc_DTO ctzDocEntity, string dfGUID)
        {
            int docContentType = (int)Enums.ContentTypes.CtzApp;

            DocEntity.docContentType = docContentType;

            long docID = doc.Insert(DocEntity);

            /// begin - insert log operation
            //DocOperationLog_Service docOpLogServ = new DocOperationLog_Service();
            //docOpLogServ.Insert(new DocOperationLog_DTO()
            //{
            //    docID = docID,
            //    docContentType= docContentType,
            //    userID = Convert.ToInt32(Session["userID"]),
            //    operationID=0
            //});

            /// end - insert log operation

            ctzDocEntity.docID = docID;
            ctzServ.Insert(ctzDocEntity);

            AttachFileTypeService attFiles = new AttachFileTypeService();

            attFiles.UpdateDocID(docID, dfGUID);

            DocOperationService docOPRServ  = new DocOperationService();
            Srv_OperationToDoc  optodocSrv  = new Srv_OperationToDoc();
            OperationToDoc_DTO  optodocItem = optodocSrv.GetOperationToDocByPosID(1, docContentType);

            docOPRServ.Insert(new DocumentOperationDTO
            {
                docID             = docID,
                userID            = Convert.ToInt32(Session["userID"]),
                fromUserID        = Convert.ToInt32(Session["userID"]),
                operationID       = optodocItem.fromid,
                operationPos      = optodocItem.positionid,
                opercode          = optodocItem.opercode,
                isActionConfirmed = 1,
                doDate            = DocEntity.docRegDate,
                docDayCount       = DocEntity.docDayCount,
                docFinishDate     = DocEntity.docFinishDate
            });

            return(RedirectToAction("Index", "Document"));
        }