コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            id = RequestData.Get <string>("id");
            if (!string.IsNullOrEmpty(id))
            {
                ent = ReceiveDocument.Find(id);
            }
            switch (RequestActionString)
            {
            case "delete":
                ent = ReceiveDocument.Find(id);
                sql = "delete from FileItem where PatIndex('%'+Id+'%','{0}')>0";
                sql = string.Format(sql, ent.Attachment);
                DataHelper.ExecSql(sql);
                ent.DoDelete();
                break;

            case "submit":
                StartFlow();
                break;

            case "AutoExecuteFlow":
                AutoExecuteFlow();
                break;

            default:
                DoSelect();
                break;
            }
        }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            op = RequestData.Get <string>("op");
            id = RequestData.Get <string>("id");
            if (!string.IsNullOrEmpty(id))
            {
                ent = ReceiveDocument.Find(id);
            }
            nextName = RequestData.Get <string>("nextName");
            switch (RequestActionString)
            {
            case "update":
                ent = GetMergedData <ReceiveDocument>();
                ent.DoUpdate();
                PageState.Add("Id", ent.Id);
                break;

            case "ConfirmYuanZhang":
                ent.YuanZhangId   = RequestData.Get <string>("YuanZhangId");
                ent.YuanZhangName = RequestData.Get <string>("YuanZhangName");
                ent.DoUpdate();
                break;

            case "GetNextUsers":
                PageState.Add("NextUsers", GetNextUser(nextName));
                break;

            case "create":
                ent = GetPostedData <ReceiveDocument>();
                ent.DoCreate();
                PageState.Add("Id", ent.Id);
                break;

            case "submit":
                StartFlow();
                break;

            case "AutoExecuteFlow":
                AutoExecuteFlow();
                break;

            case "submitfinish":
                //院办文书结束后设置文档为归档状态
                ent               = ReceiveDocument.Find(id);
                ent.State         = "已归档";
                ent.ApproveResult = RequestData.Get <string>("ApprovalState");
                ent.WorkFlowState = RequestData.Get <string>("state");
                ent.DoUpdate();
                break;

            default:
                DoSelect();
                break;
            }
        }
コード例 #3
0
        public void PostTest()
        {
            var receive = new ReceiveDocument
            {
                ID                = 1,
                Number            = "20170216111111111111",
                Title             = "测试公文",
                ConfidentialLevel = 0,
                UID               = 1,
                Category          = "测试种类1",
                Emergency         = 1,
                ReceiveWord       = "20170301",
                Keywords          = ""
            };
            var poststr = receive.ToJson();

            //Console.WriteLine(poststr);
            //_tool.Post("/api/receive/save", poststr);
            //receive.ID = 1;
            //receive.Number = "2017021612";
            //poststr = receive.ToJson();
            _tool.Put("/api/receive/edit", poststr);
        }
コード例 #4
0
        string id = String.Empty; // 对象id
        protected void Page_Load(object sender, EventArgs e)
        {
            op = RequestData.Get <string>("op");
            id = RequestData.Get <string>("id");
            ReceiveDocument ent = null;

            if (op != "c" && op != "cs")
            {
                if (!String.IsNullOrEmpty(id))
                {
                    ent = ReceiveDocument.Find(id);
                    lbComeWord.InnerHtml      = ent.ComeWord + "字第" + ent.ComeWordSize + "号";
                    lbReceiveDate.InnerHtml   = ent.ReceiveDate.Value.ToShortDateString();
                    lbBringUnit.InnerHtml     = ent.BringUnitName;
                    lbReceiveWord.InnerHtml   = ent.ReceiveWord + "字第" + ent.ReceiveWordSize + "号";
                    lbReceiveReason.InnerHtml = ent.ReceiveReason;
                    lbNiBanOpinion.InnerHtml  = ent.NiBanOpinion;
                    string sql = @"select * from Task where PatIndex('%{0}%',EFormName)>0  and  Status='4'  order by FinishTime asc";
                    sql = string.Format(sql, ent.Id);
                    PageState.Add("Opinion", DataHelper.QueryDictList(sql));
                }
            }
        }
コード例 #5
0
        private void DoSelect()
        {
            if (op != "c" && op != "cs")
            {
                ent = ReceiveDocument.Find(id);
                sql = @"select * from FileItem where PatIndex('%'+Id+'%','{0}')>0 order by CreateTime desc";
                sql = string.Format(sql, ent.MainFile);
                PageState.Add("DataList", DataHelper.QueryDictList(sql));
                sql = @"select * from FileItem where PatIndex('%'+Id+'%','{0}')>0 order by CreateTime desc";
                sql = string.Format(sql, ent.Attachment);
                PageState.Add("DataList2", DataHelper.QueryDictList(sql));
                sql = @"select * from Task where PatIndex('%{0}%',EFormName)>0  and Status='4' and Ext1 is null order by FinishTime asc";
                sql = string.Format(sql, id);
                IList <EasyDictionary> taskDics = DataHelper.QueryDictList(sql);
                PageState.Add("Opinion", taskDics);
            }
            else
            {
                ent             = new ReceiveDocument();
                ent.ReceiveDate = System.DateTime.Now.Date;
            }
            SetFormData(ent);
            string taskId = RequestData.Get <string>("TaskId");

            if (!string.IsNullOrEmpty(taskId))
            {
                Task tEnt = Task.Find(taskId);
                if (tEnt.Status != 4 && !string.IsNullOrEmpty(tEnt.Description))
                {
                    PageState.Add("UnSubmitOpinion", tEnt.Description);
                }
            }
            PageState.Add("ReceiveType", SysEnumeration.GetEnumDict("ReceiveType"));
            PageState.Add("SecrecyDegree", SysEnumeration.GetEnumDict("SecrecyDegree"));
            sql = "select * from BJKY_IntegratedManage..BringUnit";
            PageState.Add("ImportanceDegree", SysEnumeration.GetEnumDict("ImportanceDegree"));
        }
        public CosmosDbTriggerServiceOperationProvider()
        {
            this.serviceOperationsList = new List <ServiceOperation>();
            this.apiOperationsList     = new InsensitiveDictionary <ServiceOperation>();

            this.apiOperationsList.AddRange(new InsensitiveDictionary <ServiceOperation>
            {
                { "receiveDocument", ReceiveDocument },
            });

            this.serviceOperationsList.AddRange(new List <ServiceOperation>
            {
                { ReceiveDocument.CloneWithManifest(new ServiceOperationManifest
                    {
                        ConnectionReference = new ConnectionReferenceFormat
                        {
                            ReferenceKeyFormat = ConnectionReferenceKeyFormat.ServiceProvider,
                        },
                        Settings = new OperationManifestSettings
                        {
                            SecureData        = new OperationManifestSettingWithOptions <SecureDataOptions>(),
                            TrackedProperties = new OperationManifestSetting
                            {
                                Scopes = new OperationScope[] { OperationScope.Trigger },
                            },
                        },
                        InputsLocation = new InputsLocation[]
                        {
                            InputsLocation.Inputs,
                            InputsLocation.Parameters,
                        },
                        Outputs = new SwaggerSchema
                        {
                            Type       = SwaggerSchemaType.Object,
                            Properties = new OrdinalDictionary <SwaggerSchema>
                            {
                                {
                                    "body", new SwaggerSchema
                                    {
                                        Type        = SwaggerSchemaType.Array,
                                        Title       = "Receive document",
                                        Description = "Receive document description",
                                        Items       = new SwaggerSchema
                                        {
                                            Type       = SwaggerSchemaType.Object,
                                            Properties = new OrdinalDictionary <SwaggerSchema>
                                            {
                                                {
                                                    "contentData", new SwaggerSchema
                                                    {
                                                        Type        = SwaggerSchemaType.String,
                                                        Title       = "Content",
                                                        Format      = "byte",
                                                        Description = "content",
                                                    }
                                                },
                                                {
                                                    "Properties", new SwaggerSchema
                                                    {
                                                        Type  = SwaggerSchemaType.Object,
                                                        Title = "documentProperties",
                                                        AdditionalProperties = new JObject
                                                        {
                                                            { "type", "object" },
                                                            { "properties", new JObject {
                                                              } },
                                                            { "required", new JObject {
                                                              } },
                                                        },
                                                        Description = "document data properties",
                                                    }
                                                },
                                            },
                                        },
                                    }
                                },
                            },
                        },
                        Inputs = new SwaggerSchema
                        {
                            Type       = SwaggerSchemaType.Object,
                            Properties = new OrdinalDictionary <SwaggerSchema>
                            {
                                {
                                    "databaseName", new SwaggerSchema
                                    {
                                        Type        = SwaggerSchemaType.String,
                                        Title       = "database name",
                                        Description = "database name",
                                    }
                                },
                                {
                                    "collectionName", new SwaggerSchema
                                    {
                                        Type        = SwaggerSchemaType.String,
                                        Title       = "collection name",
                                        Description = "collection name",
                                    }
                                },
                            },
                            Required = new string[]
                            {
                                "databaseName",
                            },
                        },
                        Connector  = CosmosDbOperationApi,
                        Trigger    = TriggerType.Batch,
                        Recurrence = new RecurrenceSetting
                        {
                            Type = RecurrenceType.None,
                        },
                    }) },
            });
        }