Ejemplo n.º 1
0
        public static void CreatRiZhi(PJ_13dlbhjl obj)
        {


            PJ_gzrjnr gzr = new PJ_gzrjnr();
            gzr.gzrjID = gzr.CreateID();
            gzr.ParentID = obj.ID;
            Thread.Sleep(new TimeSpan(100000));//0.1毫秒
            IList<PJ_01gzrj> gzrj01 = MainHelper.PlatformSqlMap.GetList<PJ_01gzrj>("SelectPJ_01gzrjList", "where GdsCode='" + MainHelper.User.OrgCode + "' and rq between '" + DateTime.Now.ToString("yyyy-MM-dd 00:00:00") + "' and '" + DateTime.Now.ToString("yyyy-MM-dd 23:59:59") + "'");

            if (gzrj01.Count > 0)
            {
                gzr.gzrjID = gzrj01[0].gzrjID;
            }
            else
            {
                PJ_01gzrj pj = new PJ_01gzrj();
                pj.gzrjID = pj.CreateID();
                pj.GdsCode = MainHelper.User.OrgCode;
                pj.GdsName = MainHelper.User.OrgName;
                pj.CreateDate = DateTime.Now;
                pj.CreateMan = MainHelper.User.UserName;
                gzr.gzrjID = pj.gzrjID;
                pj.rq = DateTime.Now.Date;
                pj.xq = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetDayName(DateTime.Now.DayOfWeek);
                pj.rsaqts = (DateTime.Today - MainHelper.UserOrg.PSafeTime.Date).Days;
                pj.sbaqts = (DateTime.Today - MainHelper.UserOrg.DSafeTime.Date).Days;
                Thread.Sleep(new TimeSpan(100000));//0.1毫秒
                MainHelper.PlatformSqlMap.Create<PJ_01gzrj>(pj);


            }
            IList<PJ_gzrjnr> gzrlist = MainHelper.PlatformSqlMap.GetList<PJ_gzrjnr>("SelectPJ_gzrjnrList", "where gzrjID  = '" + gzr.gzrjID + "' order by seq  ");
            if (gzrlist.Count > 0)
            {
                gzr.seq = gzrlist[gzrlist.Count - 1].seq + 1;
            }
            else
                gzr.seq = 1;

            gzr.gznr = "全所目前运行的×个台区剩余电流动作保护期测试";
            gzr.fzr = "配电班长";
            string[] strli = obj.csr.Split(';');
            if (strli.Length < 3)
                gzr.cjry = obj.csr;
            else
            {
                gzr.cjry = strli[0] + "、" + strli[1] + "等" + strli.Length + "人";
            }
            gzr.CreateDate = DateTime.Now;
            gzr.CreateMan = MainHelper.User.UserName;
            gzr.fssj = DateTime.Now;
            MainHelper.PlatformSqlMap.Create<PJ_gzrjnr>(gzr);

        }
Ejemplo n.º 2
0
        public static void CreatRiZhi(PJ_09pxjl obj)
        {


            PJ_gzrjnr gzr = new PJ_gzrjnr();
            gzr.gzrjID = gzr.CreateID();
            gzr.ParentID = obj.ID;
            Thread.Sleep(new TimeSpan(100000));//0.1毫秒
            IList<PJ_01gzrj> gzrj01 = MainHelper.PlatformSqlMap.GetList<PJ_01gzrj>("SelectPJ_01gzrjList", "where GdsCode='" + MainHelper.User.OrgCode + "' and rq between '" + obj.rq.ToString("yyyy-MM-dd 00:00:00") + "' and '" + obj.rq.ToString("yyyy-MM-dd 23:59:59") + "'");

            if (gzrj01.Count > 0)
            {
                gzr.gzrjID = gzrj01[0].gzrjID;
            }
            else
            {
                PJ_01gzrj pj = new PJ_01gzrj();
                pj.gzrjID = pj.CreateID();
                pj.GdsCode = obj.OrgCode;
                pj.GdsName = obj.OrgName;
                pj.CreateDate = obj.rq;
                pj.CreateMan = MainHelper.User.UserName;
                gzr.gzrjID = pj.gzrjID;
                pj.rq = obj.rq;
                pj.xq = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetDayName(DateTime.Now.DayOfWeek);
                pj.rsaqts = (DateTime.Today - MainHelper.UserOrg.PSafeTime.Date).Days;
                pj.sbaqts = (DateTime.Today - MainHelper.UserOrg.DSafeTime.Date).Days;
                Thread.Sleep(new TimeSpan(100000));//0.1毫秒
                MainHelper.PlatformSqlMap.Create<PJ_01gzrj>(pj);


            }
            IList<PJ_gzrjnr> gzrlist = MainHelper.PlatformSqlMap.GetList<PJ_gzrjnr>("SelectPJ_gzrjnrList", "where gzrjID  = '" + gzr.gzrjID + "' order by seq  ");
            if (gzrlist.Count > 0)
            {
                gzr.seq = gzrlist[gzrlist.Count - 1].seq + 1;
            }
            else
                gzr.seq = 1;

            gzr.gznr =obj.hydd+ "职工培训";
            gzr.fzr = obj.zcr;

            gzr.cjry = obj.zcr + "等" + gzr.cjry + "人";

            gzr.CreateDate = obj.rq;
            gzr.CreateMan = MainHelper.User.UserName;
            gzr.fssj = obj.rq;
            MainHelper.PlatformSqlMap.Create<PJ_gzrjnr>(gzr);

        }
Ejemplo n.º 3
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            //if (recordStatus == 0)
            //{

            PJ_gzrjnr gzr = new PJ_gzrjnr();
            PJ_03yxfx yxfx = RowData as PJ_03yxfx;
            object obj = MainHelper.PlatformSqlMap.GetOneByKey<PJ_03yxfx>(yxfx.ID);
            if (obj == null)
            {
                rowData.gznrID = gzr.gznrID;
                gzr.ParentID = yxfx.ID;
                yxfx.CreateDate = DateTime.Now;
                yxfx.CreateMan = MainHelper.User.UserName;
                IList<PJ_01gzrj> gzrj01 = MainHelper.PlatformSqlMap.GetList<PJ_01gzrj>("SelectPJ_01gzrjList", "where rq between '" + rowData.rq.ToString("yyyy-MM-dd 00:00:00") + "' and '" + rowData.rq.ToString("yyyy-MM-dd 23:59:59") + "'");
                if (gzrj01.Count > 0)
                {
                    gzr.gzrjID = gzrj01[0].gzrjID;
                }
                else
                {
                    PJ_01gzrj pj = new PJ_01gzrj();
                    pj.gzrjID = pj.CreateID();
                    pj.GdsCode = rowData.OrgCode;
                    pj.GdsName = rowData.OrgName;
                    pj.CreateDate = rowData.rq;
                    pj.CreateMan = MainHelper.User.UserName;
                    gzr.gzrjID = pj.gzrjID;
                    pj.rq = rowData.rq;
                    pj.xq = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetDayName(DateTime.Now.DayOfWeek);
                    pj.rsaqts = (DateTime.Today - MainHelper.UserOrg.PSafeTime.Date).Days;
                    pj.sbaqts = (DateTime.Today - MainHelper.UserOrg.DSafeTime.Date).Days;
                    Thread.Sleep(new TimeSpan(100000));//0.1毫秒
                    MainHelper.PlatformSqlMap.Create<PJ_01gzrj>(pj);


                }
                IList<PJ_gzrjnr> gzrlist = MainHelper.PlatformSqlMap.GetList<PJ_gzrjnr>("SelectPJ_gzrjnrList", "where ParentID  = '" + gzr.ParentID + "' order by seq  ");
                if (gzrlist.Count > 0)
                {
                    gzr.seq = gzrlist[gzrlist.Count - 1].seq + 1;
                }
                else
                    gzr.seq = 1;
                gzr.gznr = yxfx.hydd + "运行分析-" + yxfx.type;
                gzr.fzr = yxfx.zcr;
                gzr.fssj = yxfx.rq;
                string[] ss = yxfx.cjry.Split(';');
                if (ss.Length >= 1)
                {

                    gzr.cjry = ss[0] + ss[1];
                    if (ss.Length > 2) gzr.cjry = gzr.cjry + "等";
                    gzr.cjry = gzr.cjry + ss.Length + "人";
                }
                else
                {
                    gzr.cjry = gzr.fzr;
                }





                MainHelper.PlatformSqlMap.Create<PJ_gzrjnr>(gzr);
                MainHelper.PlatformSqlMap.Create<PJ_03yxfx>(yxfx);
            }
            else
            {
                yxfx.CreateDate = yxfx.rq;
                MainHelper.PlatformSqlMap.Update<PJ_03yxfx>(RowData);
            }
            //string strmes = RecordWorkTask.RunNewYXFXRecord(rowData.ID, yxfx.type,MainHelper.User.UserID   );

            //if (strmes.IndexOf("未提交至任何人") > -1)
            //{
            //    MsgBox.ShowTipMessageBox("未提交至任何人,创建失败,请检查流程模板和组织机构配置是否正确!");
            //    return;
            //}
            //else
            //    MsgBox.ShowTipMessageBox(strmes);
            //if (gzrj01.Count > 0)
            //    MainHelper.PlatformSqlMap.Create<PJ_gzrjnr>(gzr);
            //MainHelper.PlatformSqlMap.Create<PJ_03yxfx>(yxfx);
            //this.Close();
            //}
            //else
            //{
            //    //try
            //    //{
            //    //    string strmes = RecordWorkTask.RunWorkFlow(MainHelper.User.UserID, WorkFlowData.Rows[0]["OperatorInsId"].ToString(), WorkFlowData.Rows[0]["WorkTaskInsId"].ToString(), "提交");
            //    //    if (strmes.IndexOf("未提交至任何人") > -1)
            //    //    {
            //    //        MsgBox.ShowTipMessageBox("未提交至任何人,创建失败,请检查流程模板和组织机构配置是否正确!");
            //    //        return;
            //    //    }
            //    //    else
            //    //        MsgBox.ShowTipMessageBox(strmes);

            //    //}
            //    //catch (System.Exception ex)
            //    //{

            //    //}

            //    MainHelper.PlatformSqlMap.Update<PJ_03yxfx>(RowData);

            //}

            //this.Close(); 
        }
Ejemplo n.º 4
0
        //ExcelAccess
        public static void ExportExcel(PJ_01gzrj jl, IList<PJ_gzrjnr> nrList) {
            nrList = getRjnrList(jl.gzrjID);
            ExcelAccess ex = new ExcelAccess();
            SaveFileDialog saveFileDialog1 = new SaveFileDialog();
            string fname = Application.StartupPath + "\\00记录模板\\01工作日志.xls";
            ex.Open(fname);
            int row = 1;
            int col = 1;
            int row_nr = 9;
            int row_num = 36 * 2;
            List<string> strpy = Ecommon.ResultStrList("领导检查评语:" + jl.py, row_num);
            List<string> strjs = Ecommon.ResultStrList("记事:" + jl.js, row_num);
            int nrpage = Ecommon.GetPagecount(nrList.Count, 9);
            int p = Math.Max(Ecommon.GetPagecount(strpy.Count + strjs.Count, 5), nrpage);
            System.Collections.ArrayList objlist = new System.Collections.ArrayList();
            objlist.Add(strjs);
            objlist.Add(strpy);
            List<string> allList = Ecommon.GetCollList(objlist);
            
            for (int j = 1; j <= p; j++) {
                if (j > 1) {
                    ex.CopySheet(1, 1);
                }
            }
            for (int j = 1; j <= p; j++) {
                ex.ActiveSheet(j);
                ex.ReNameWorkSheet(j, "Sheet" + (j));
                setHead(ex, jl);
                if (j == 1) {
                    setHead2(ex, jl);
                }
                int prepageindex = j - 1;
                //主题
                int starownr = prepageindex * 9 + 1;
                int js = prepageindex * 5 + 1;
                int endrownr = j * 9;
                int endrowjs = j * 5;
                int bh = 0;
                if (nrList.Count > endrownr) {
                    for (int i = 0; i < 9; i++) {
                        bh++;
                        PJ_gzrjnr obj = nrList[starownr - 1 + i];
                        ex.SetCellValue(obj.seq > 0 ? obj.seq.ToString() : "", row + 9 + i, col);
                        ex.SetCellValue(obj.gznr, row + 9 + i, col + 1);
                        ex.SetCellValue(obj.fzr, row + 9 + i, col + 8);
                        string[] rr = obj.cjry.Split(";".ToCharArray());
                        if (rr.Length > 2)
                        {
                            string cry = rr[0]+ rr[1] + "等" + rr.Length + "人";

                            ex.SetCellValue(cry, row + 9 + i, col + 11);
                        }
                        else
                            ex.SetCellValue(obj.cjry, row + 9 + i, col + 11);

                    }
                } else if (nrList.Count <= endrownr && nrList.Count >= starownr) {
                    for (int i = 0; i < nrList.Count - starownr + 1; i++) {
                        PJ_gzrjnr obj = nrList[starownr - 1 + i];
                        ex.SetCellValue(obj.seq > 0 ? obj.seq.ToString() : "", row + 9 + i, col);
                        ex.SetCellValue(obj.gznr, row + 9 + i, col + 1);
                        ex.SetCellValue(obj.fzr, row + 9 + i, col + 8);
                        string[] rr = obj.cjry.Split(";".ToCharArray());
                        if (rr.Length > 2)
                        {
                            string cry = rr[0] + rr[1] + "等" + rr.Length + "人";

                            ex.SetCellValue(cry, row + 9 + i, col + 11);
                        }
                        else
                            ex.SetCellValue(obj.cjry, row + 9 + i, col + 11);
                    }
                }
                if (allList.Count > endrowjs) {
                    for (int i = 0; i < 5; i++) {
                        ex.SetCellValue(allList[js - 1 + i], row + 18 + i, col);
                    }
                } else if (allList.Count <= endrowjs && allList.Count >= js) {
                    for (int i = 0; i < allList.Count - js + 1; i++) {
                        ex.SetCellValue(allList[js - 1 + i], row + 18 + i, col);
                    }
                }
            }
            ex.ActiveSheet(1);
            ex.ShowExcel();

        }
Ejemplo n.º 5
0
        /// <summary>
        /// 填充人员
        /// </summary>
        /// <param name="ex"></param>
        /// <param name="jl"></param>
        private static void setHead2(ExcelAccess ex, PJ_01gzrj jl) {
            int row = 1;
            int col = 1;
           
            //姓名、原因
            string[] rr = new string[10];
            string[] yy = new string[10];
            string[] rr2 = jl.qqry.Split(";".ToCharArray());
            for (int i = 0; i < rr2.Length - 1; i++) {
                rr[i] = rr2[i].Split(":".ToCharArray())[0];
                yy[i] = rr2[i].Split(":".ToCharArray())[1];
            }
            for (int i = rr2.Length - 1; i < rr.Length; i++) {
                rr[i] = "";
                yy[i] = "";
            }
            ex.SetCellValue(rr[0], row + 4, col + 2);
            ex.SetCellValue(rr[1], row + 4, col + 4);
            ex.SetCellValue(rr[2], row + 4, col + 6);
            ex.SetCellValue(rr[3], row + 4, col + 8);
            ex.SetCellValue(rr[4], row + 4, col + 10);
            ex.SetCellValue(rr[5], row + 6, col + 2);
            ex.SetCellValue(rr[6], row + 6, col + 4);
            ex.SetCellValue(rr[7], row + 6, col + 6);
            ex.SetCellValue(rr[8], row + 6, col + 8);
            ex.SetCellValue(rr[9], row + 6, col + 10);
            ex.SetCellValue(yy[0], row + 5, col + 2);
            ex.SetCellValue(yy[1], row + 5, col + 4);
            ex.SetCellValue(yy[2], row + 5, col + 6);
            ex.SetCellValue(yy[3], row + 5, col + 8);
            ex.SetCellValue(yy[4], row + 5, col + 10);
            ex.SetCellValue(yy[5], row + 7, col + 2);
            ex.SetCellValue(yy[6], row + 7, col + 4);
            ex.SetCellValue(yy[7], row + 7, col + 6);
            ex.SetCellValue(yy[8], row + 7, col + 8);
            ex.SetCellValue(yy[9], row + 7, col + 10);

            //人身,设备
            ex.SetCellValue(jl.rsaqts.ToString(), row + 5, col + 13);
            ex.SetCellValue(jl.sbaqts.ToString(), row + 7, col + 13);
        }
Ejemplo n.º 6
0
 /// <summary>
 /// 填充头尾
 /// </summary>
 /// <param name="ex"></param>
 /// <param name="jl"></param>
 private static void setHead(ExcelAccess ex, PJ_01gzrj jl) {
     int row = 1;
     int col = 1;
     int row_nr = 9;
     //日期
     ex.SetCellValue(jl.rq.Year.ToString(), row + 3, col + 1);
     ex.SetCellValue(jl.rq.Month.ToString(), row + 3, col + 3);
     ex.SetCellValue(jl.rq.Day.ToString(), row + 3, col + 5);
     ex.SetCellValue(jl.xq.Replace("星期", ""), row + 3, col + 10);
     ////签字、时间
     //ex.SetCellValue(jl.qz, row + 14 + row_nr, col + 2);
     //if (ComboBoxHelper.CompreDate(jl.qzrq))
     //{
     //    ex.SetCellValue(jl.qzrq.Year.ToString(), row + 14 + row_nr, col + 6);
     //    ex.SetCellValue(jl.qzrq.Month.ToString(), row + 14 + row_nr, col + 9);
     //    ex.SetCellValue(jl.qzrq.Day.ToString(), row + 14 + row_nr, col + 11);
     //}
     
 }
Ejemplo n.º 7
0
 /// <summary>
 /// 新建对象设置Key值
 /// </summary>
 /// <param name="newobj"></param>
 void gridViewOperation_CreatingObjectEvent(PJ_01gzrj newobj)
 {
     if (parentID == null) return;
     newobj.GdsCode = parentID;
     newobj.GdsName = parentObj.OrgName;
     newobj.CreateDate = DateTime.Now;
     Ebada.Core.UserBase m_UserBase = MainHelper.ValidateLogin();
     newobj.CreateMan = m_UserBase.RealName;
     newobj.rq = DateTime.Now.Date;
     newobj.xq = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetDayName(DateTime.Now.DayOfWeek);
     newobj.rsaqts = (DateTime.Today - parentObj.PSafeTime.Date).Days;
     newobj.sbaqts = (DateTime.Today - parentObj.DSafeTime.Date).Days;
 }
Ejemplo n.º 8
0
        /// <summary>
        /// 生成日志记录
        /// </summary>
        /// <param name="WorkFlowData">流程数据信息</param>
        /// <param name="dsoFramerWordControl1">Excel控件</param>
        /// <param name="recordID">记录ID</param>
        /// <param name="modlecordlist">模块相关记录集</param>
        public static void CreatRiZhi(DataTable WorkFlowData, DSOFramerControl dsoFramerWordControl1, string recordID, params   object[] modlecordlist)
        {

            WF_TaskVar tvAddress = RecordWorkTask.GetWorkTaskRiZhi(WorkFlowData, "工作地点");
            WF_TaskVar tvProject = RecordWorkTask.GetWorkTaskRiZhi(WorkFlowData, "项目");
            WF_TaskVar tvCharMan = RecordWorkTask.GetWorkTaskRiZhi(WorkFlowData, "负责人");
            WF_TaskVar tvAttendMan = RecordWorkTask.GetWorkTaskRiZhi(WorkFlowData, "参加人员");

            PJ_gzrjnr gzr = new PJ_gzrjnr();
            gzr.gzrjID = gzr.CreateID();
            gzr.ParentID = recordID;
            Thread.Sleep(new TimeSpan(100000));//0.1毫秒
            IList<PJ_01gzrj> gzrj01 = MainHelper.PlatformSqlMap.GetList<PJ_01gzrj>("SelectPJ_01gzrjList", "where GdsCode='" + MainHelper.User.OrgCode + "' and rq between '" + DateTime.Now.ToString("yyyy-MM-dd 00:00:00") + "' and '" + DateTime.Now.ToString("yyyy-MM-dd 23:59:59") + "'");

            if (gzrj01.Count > 0)
            {
                gzr.gzrjID = gzrj01[0].gzrjID;
                //gzrj01[0].GdsCode = MainHelper.User.OrgCode;
                //gzrj01[0].GdsName = MainHelper.User.OrgName;
                //MainHelper.PlatformSqlMap.Update<PJ_01gzrj>(gzrj01[0]);
            }
            else
            {
                PJ_01gzrj pj = new PJ_01gzrj();
                pj.gzrjID = pj.CreateID();
                pj.GdsCode = MainHelper.User.OrgCode;
                pj.GdsName = MainHelper.User.OrgName;
                pj.CreateDate = DateTime.Now;
                pj.CreateMan = MainHelper.User.UserName;
                gzr.gzrjID = pj.gzrjID;
                pj.rq = DateTime.Now.Date;
                pj.xq = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetDayName(DateTime.Now.DayOfWeek);
                pj.rsaqts = (DateTime.Today - MainHelper.UserOrg.PSafeTime.Date).Days;
                pj.sbaqts = (DateTime.Today - MainHelper.UserOrg.DSafeTime.Date).Days;
                Thread.Sleep(new TimeSpan(100000));//0.1毫秒
                MainHelper.PlatformSqlMap.Create<PJ_01gzrj>(pj);

                //MsgBox.ShowWarningMessageBox("未填写今日工作日记");
                //return;
            }
            IList<PJ_gzrjnr> gzrlist = MainHelper.PlatformSqlMap.GetList<PJ_gzrjnr>("SelectPJ_gzrjnrList", "where gzrjID  = '" + gzr.gzrjID + "' order by seq  ");
            if (gzrlist.Count > 0)
            {
                gzr.seq = gzrlist[gzrlist.Count - 1].seq + 1;
            }
            else
                gzr.seq = 1;

            gzr.gznr = GetTaskVarRiZhiValue(tvAddress, dsoFramerWordControl1, recordID, GetModleRecordObj(tvAddress, modlecordlist))
                + GetTaskVarRiZhiValue(tvProject, dsoFramerWordControl1, recordID, GetModleRecordObj(tvProject, modlecordlist));
            gzr.fzr = GetTaskVarRiZhiValue(tvCharMan, dsoFramerWordControl1, recordID, GetModleRecordObj(tvCharMan, modlecordlist));
            gzr.cjry = GetTaskVarRiZhiValue(tvAttendMan, dsoFramerWordControl1, recordID, GetModleRecordObj(tvAttendMan, modlecordlist));
            gzr.CreateDate = DateTime.Now;
            gzr.CreateMan = MainHelper.User.UserName;
            gzr.fssj = DateTime.Now;
            MainHelper.PlatformSqlMap.Create<PJ_gzrjnr>(gzr);

        }
Ejemplo n.º 9
0
 void ucTop_FocusedRowChanged(object sender, PJ_01gzrj obj)
 {
     ucBottom.ParentObj = obj;
     splitCC1.Panel2.Text = "内容日期:" + (obj != null ? obj.rq.ToShortDateString() : "");
 }
Ejemplo n.º 10
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            string strmes = "";
            PJ_03yxfx yxfx = RowData as PJ_03yxfx;
            object obj = MainHelper.PlatformSqlMap.GetOneByKey<PJ_03yxfx>(yxfx.ID);
            if (obj == null)
            {

                yxfx.CreateDate = DateTime.Now;
                yxfx.CreateMan = MainHelper.User.UserName;
                MainHelper.PlatformSqlMap.Create<PJ_03yxfx>(yxfx);
                if (isWorkflowCall)
                {
                    WF_ModleRecordWorkTaskIns mrwt = new WF_ModleRecordWorkTaskIns();
                    mrwt.ModleRecordID = yxfx.ID;
                    mrwt.RecordID = currRecord.ID;
                    mrwt.WorkFlowId = WorkFlowData.Rows[0]["WorkFlowId"].ToString();
                    mrwt.WorkFlowInsId = WorkFlowData.Rows[0]["WorkFlowInsId"].ToString();
                    mrwt.WorkTaskId = WorkFlowData.Rows[0]["WorkTaskId"].ToString();
                    mrwt.ModleTableName = yxfx.GetType().ToString();
                    mrwt.WorkTaskInsId = WorkFlowData.Rows[0]["WorkTaskInsId"].ToString();
                    mrwt.CreatTime = DateTime.Now;
                    MainHelper.PlatformSqlMap.Create<WF_ModleRecordWorkTaskIns>(mrwt);
                }
                PJ_gzrjnr gzr = new PJ_gzrjnr();
                gzr.ParentID = yxfx.ID;
                IList<PJ_01gzrj> gzrj01 = MainHelper.PlatformSqlMap.GetList<PJ_01gzrj>("SelectPJ_01gzrjList", "where GdsCode='" + MainHelper.User.OrgCode + "' and rq between '" + DateTime.Now.ToString("yyyy-MM-dd 00:00:00") + "' and '" + DateTime.Now.ToString("yyyy-MM-dd 23:59:59") + "'");
                if (gzrj01.Count > 0)
                {
                    gzr.gzrjID = gzrj01[0].gzrjID;
                }
                else
                {
                    PJ_01gzrj pj = new PJ_01gzrj();
                    pj.gzrjID = pj.CreateID();
                    pj.GdsCode = MainHelper.User.OrgCode;
                    pj.GdsName = MainHelper.User.OrgName;
                    pj.CreateDate = DateTime.Now;
                    pj.CreateMan = MainHelper.User.UserName;
                    gzr.gzrjID = pj.gzrjID;
                    pj.rq = DateTime.Now.Date;
                    pj.xq = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetDayName(DateTime.Now.DayOfWeek);
                    pj.rsaqts = (DateTime.Today - MainHelper.UserOrg.PSafeTime.Date).Days;
                    pj.sbaqts = (DateTime.Today - MainHelper.UserOrg.DSafeTime.Date).Days;
                    Thread.Sleep(new TimeSpan(100000));//0.1毫秒
                    MainHelper.PlatformSqlMap.Create<PJ_01gzrj>(pj);


                }
                IList<PJ_gzrjnr> gzrlist = MainHelper.PlatformSqlMap.GetList<PJ_gzrjnr>("SelectPJ_gzrjnrList", "where ParentID  = '" + gzr.ParentID + "' order by seq  ");
                if (gzrlist.Count > 0)
                {
                    gzr.seq = gzrlist[gzrlist.Count - 1].seq + 1;
                }
                else
                    gzr.seq = 1;
                gzr.gznr = yxfx.hydd + "运行分析-" + yxfx.type;
                gzr.fzr = yxfx.zcr;
                gzr.fssj = yxfx.rq;
                string[] ss = yxfx.cjry.Split(';');
                if (ss.Length >= 1)
                {

                    gzr.cjry = ss[0] + "、" + ss[1];
                    if (ss.Length > 2) gzr.cjry = gzr.cjry + "等";
                    gzr.cjry = gzr.cjry + ss.Length + "人";
                }
                else
                {
                    gzr.cjry = gzr.fzr;
                }





                MainHelper.PlatformSqlMap.Create<PJ_gzrjnr>(gzr);
            }
            else
            {
                MainHelper.PlatformSqlMap.Update<PJ_03yxfx>(RowData);

            }
            //currRecord.ImageAttachment = bt;
            //currRecord.SignImg = bt;
            currRecord.LastChangeTime = DateTime.Now.ToString();
            if (RecordWorkTask.CheckOnRiZhi(WorkFlowData))
            {

                RecordWorkTask.CreatRiZhi(WorkFlowData, null, currRecord.ID, new object[] { yxfx, currRecord });

            }
            WF_WorkTaskCommands wt;
            //string[] strtemp = RecordWorkTask.RunNewGZPRecord(currRecord.ID, kind, MainHelper.User.UserID);
            wt = (WF_WorkTaskCommands)MainHelper.PlatformSqlMap.GetObject("SelectWF_WorkTaskCommandsList", " where WorkFlowId='" + WorkFlowData.Rows[0]["WorkFlowId"].ToString() + "' and WorkTaskId='" + WorkFlowData.Rows[0]["WorkTaskId"].ToString() + "'");
            if (wt != null)
            {
                strmes = RecordWorkTask.RunWorkFlow(MainHelper.User.UserID, WorkFlowData.Rows[0]["OperatorInsId"].ToString(), WorkFlowData.Rows[0]["WorkTaskInsId"].ToString(), wt.CommandName);
            }
            else
            {
                strmes = RecordWorkTask.RunWorkFlow(MainHelper.User.UserID, WorkFlowData.Rows[0]["OperatorInsId"].ToString(), WorkFlowData.Rows[0]["WorkTaskInsId"].ToString(), "提交");
            }
            if (strmes.IndexOf("未提交至任何人") > -1)
            {
                MsgBox.ShowTipMessageBox("未提交至任何人,创建失败,请检查流程模板和组织机构配置是否正确!");
                return;
            }
            else
                MsgBox.ShowTipMessageBox(strmes);
            strmes = RecordWorkTask.GetWorkFlowTaskCaption(WorkFlowData.Rows[0]["WorkTaskInsId"].ToString());
            if (strmes == "结束节点1")
            {
                currRecord.Status = "存档";
            }
            else
            {
                currRecord.Status = strmes;
            }
            if (currRecord.ImageAttachment == null)
            {
                currRecord.ImageAttachment = new byte[0];
            }
            if (currRecord.DocContent == null)
            {
                currRecord.DocContent = new byte[0];
            }
            if (currRecord.SignImg == null)
            {
                currRecord.SignImg = new byte[0];
            }
            Export03.ExportExcelWorkFlow(ref  currRecord, (PJ_03yxfx)RowData);
            if (currRecord.ImageAttachment == null) currRecord.ImageAttachment = new byte[0];
            if (currRecord.SignImg == null) currRecord.SignImg = new byte[0];
            currRecord.LastChangeTime = DateTime.Now.ToString();
            MainHelper.PlatformSqlMap.Update("UpdateLP_Record", currRecord);
            //this.Close(); 
        }