コード例 #1
0
        public FormFieldCollection GetSysFields()
        {
            FormFieldCollection ffc = new FormFieldCollection();

            foreach (FormField ff in this._FORM_FIELDS)
            {
                if (!String.IsNullOrEmpty(ff.Type))
                {
                    ffc.Add(ff);
                }
            }
            return(ffc);
        }
コード例 #2
0
 public FormFieldCollection_Enumerator(FormFieldCollection t)
 {
     this.t = t;
 }
コード例 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //进入条件
                if (Request["Flow_Id"] != null && Request["Flow_Id"] != "")
                {
                    flow            = WX.Flow.Model.Flow.GetCache(rFlowId); //WX.Flow.Model.Flow.NewDataModel(rFlowId);
                    this.FormId     = flow.FormId.ToInt32();
                    MenuBar1.Param1 = this.rFlowId.ToString();
                    bool b = flow.GetProcessByStep(1).GetInAccess(null);
                    if (b == false || flow.IsVisible.ToInt32() == 1)
                    {
                        this.btnSubmit.Enabled = false;
                        this.tooltip.InnerText = flow.GetProcessByStep(1).GetInMsg(null);
                    }
                    //填充流程信息及新工作流水号
                    flow.LoadNumberRule(false);
                    string name = flow.Name.value.ToString();

                    //表单
                    WX.Flow.Model.Form.MODEL formmodel = WX.Flow.Model.Form.NewDataModel(flow.FormId);
                    //WX.Flow.Model.Run.MODEL runmodel;
                    //runmodel = WX.Flow.Model.Run.NewDataModel();
                    //runmodel.FlowId.value = flow.Id.value;
                    ////2.装载Form表单
                    //runmodel.LoadMyFlow(false);
                    //runmodel.LoadMyForm(false);

                    WX.Flow.FormFieldCollection ffedit   = new WX.Flow.FormFieldCollection();
                    WX.Flow.FormFieldCollection ffhidden = new WX.Flow.FormFieldCollection();
                    Literal1.Text = formmodel.GenerateHtmls(formmodel.Items_FormFieldCollection, ffedit, ffhidden, WX.Main.CurUser.UserID).Replace("-SYS_IP-", getIp());
                }
                if (Request["RunID"] != null && Request["RunID"] != "")
                {
                    WX.Flow.Model.Run.MODEL runmodel;
                    runmodel        = WX.Flow.Model.Run.GetModel("select * from FL_Run where Id=" + Request["RunID"]);
                    MenuBar1.Param1 = runmodel.FlowId.ToString();
                    flow            = WX.Flow.Model.Flow.NewDataModel(runmodel.FlowId.ToInt32());
                    //2.装载Form表单
                    runmodel.LoadMyForm(false);
                    Literal1.Text             = runmodel.GenerateHtmls(runmodel.Id.ToInt32());
                    this.txtSerialNumber.Text = runmodel.Name.ToString(); //String.Format("{0}({1})", name, number);
                    btnSubmit.Visible         = false;
                }
                else
                {
                    this.txtSerialNumber.Text = String.Format("{0}({1})", flow.Name.ToString(), WX.Flow.Model.Run.GetFileCode(rFlowId));
                }
                this.labDescription.Text = flow.Description.value.ToString();
                //填充流程步骤列表
                System.Data.DataTable query;
                if (Request["RunID"] != null)
                {
                    query = ULCode.QDA.XSql.GetDataTable("select A.StepNo,A.Name,A.Next_Nodes,emp.RealName+':'+C.Content username from FL_Process A Left join FL_Run B on A.FlowID=B.FlowID left join FL_RunFeedBack C on B.ID=C.RunID and A.StepNo=C.StepNo left join TU_Users emp on C.CheckUserID=emp.UserId where A.FlowId=" + flow.Id.ToString() + " and B.ID=" + Request["RunID"] + " order by A.StepNo asc");
                }
                else
                {
                    query = ULCode.QDA.XSql.GetDataTable("select StepNo,Name,Next_Nodes,'' username from FL_Process where FlowId=" + flow.Id.ToString() + " order by StepNo asc");
                }
                this.ProcessRepeater.DataSource = query;
                this.ProcessRepeater.DataBind();
            }
        }
コード例 #4
0
        }/// <summary>

        /// 保存表单及其它功能按钮
        /// </summary>
        private int Save(int rRunId, int rStepId)
        {
            //1.获取模型
            WX.Flow.Model.Run.MODEL     runmodel = WX.Flow.Model.Run.NewDataModel(rRunId);
            WX.Flow.Model.Process.MODEL process  = WX.Flow.Model.Process.GetModel("select * from FL_Process where FlowID=" + runmodel.FlowId.ToString() + " and StepNo=" + (runmodel.StepNo.ToInt32() + 1));
            if (process == null)
            {
                runmodel.Deal_Flag.value = DealFlag.HasOperated;
            }
            else
            {
                runmodel.Deal_Flag.value = DealFlag.NotReceived;
                if (process.Next_Nodes.ToString() != "")
                {
                    runmodel.Next_Nodes.value = process.Next_Nodes.value;
                }
                else
                {
                    WX.Flow.Model.Process.MODEL proc = WX.Flow.Model.Process.GetModel("select * from FL_Process where FlowID=" + runmodel.FlowId.ToString() + " and StepNo=" + runmodel.StepNo.ToInt32());
                    runmodel.Next_Nodes.value = proc.Next_Nodes.value;
                }
                runmodel.StepNo.value = process.StepNo.value;
            }
            //2.取表单值
            runmodel.LoadMyForm(false);
            WX.Flow.FormFieldCollection ffc = runmodel.MyForm.GetPostedDatas();
            //3.上传附件并取得附件列表
            string             attach_nameList = String.Empty;
            string             attache_idlist  = String.Empty;
            string             uploadUserId    = WX.Main.CurUser.UserID;
            string             uploadIp        = WX.Main.getIp(this);
            HttpFileCollection hfc             = Request.Files;

            for (int i = 0; i < hfc.Count; i++)
            {
                HttpPostedFile hpf = hfc[i];
                // 取文件后缀名
                string oldFileName = System.IO.Path.GetFileName(hpf.FileName);
                string ext         = System.IO.Path.GetExtension(hpf.FileName);
                string newFileName = DateTime.Now.ToString("yyyyMMddhhmmss fff") + ext;
                string newPath     = String.Format("/UploadFiles/Run/{0}", newFileName);
                if (hpf.ContentLength > 0)
                {
                    try
                    {
                        hpf.SaveAs(Server.MapPath(newPath));
                        //上传成功了
                        DateTime uploadTime = DateTime.Now;
                        string   cmdText    = String.Format("INSERT INTO FL_RunAttachs (RunId,StepNo,NewFileName,OldFileName,UploadUserID,UploadTime,UploadIP)"
                                                            + " VALUES ('{0}','{1}','{2}','{3}','{4}','{5}','{6}');SELECT @@IDENTITY as  IdentityID;"
                                                            , rRunId, rStepId, newPath, oldFileName, uploadUserId, DateTime.Now, uploadIp);
                        int id = ULCode.QDA.XSql.GetData(cmdText).ToInt32();
                        if (attach_nameList.Length > 0)
                        {
                            attach_nameList = attach_nameList + ",";
                        }
                        attach_nameList = attach_nameList + oldFileName;
                        if (attache_idlist.Length > 0)
                        {
                            attache_idlist = attache_idlist + ",";
                        }
                        attache_idlist = attache_idlist + id;
                    }
                    catch
                    {
                        ;
                    }
                }
            }
            //WX.Flow.FormFieldCollection ffc = new WX.Flow.FormFieldCollection();
            //foreach (WX.Flow.FormField ff in runmodel.MyForm.Items_FormFieldCollection)
            //{
            //    ff.Value = this.Request.Form[ff.Id] == null ? "" : this.Request.Form[ff.Id];
            //    ffc.Add(ff);
            //}
            //
            //4.取得手写与签章信息
            int iR = runmodel.Save(rStepId, ffc, attache_idlist, attach_nameList, "", "", 0);//最后两个参数为会签意见和手写签章信息

            runmodel.Update();
            return(0);// iR;
        }