Ejemplo n.º 1
0
        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 = WX.Flow.DealFlag.HasOperated;
            }
            else
            {
                runmodel.Deal_Flag.value = WX.Flow.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;
            //4.取得手写与签章信息
            int iR = runmodel.Save(rStepId, ffc, attache_idlist, attach_nameList, "", "", 0);//最后两个参数为会签意见和手写签章信息

            runmodel.Update();
            return(0);// iR;
        }
Ejemplo n.º 2
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=" + rStepId);
            if (process == null)
            {
                runmodel.Deal_Flag.value = WX.Flow.DealFlag.HasOperated;
            }
            else
            {
                runmodel.Deal_Flag.value = WX.Flow.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.取表单值

            WX.Flow.FormFieldCollection ffc = new WX.Flow.FormFieldCollection();
            //3.上传附件并取得附件列表
            string attach_nameList = String.Empty;
            string attache_idlist  = String.Empty;

            //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(iR);
        }
Ejemplo n.º 3
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;
        }