Ejemplo n.º 1
0
        private void btAddfrm_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) {
            if (MainHelper.UserOrg == null) return;

            if (!RecordWorkTask.HaveRunNewGZPRole(strKind, MainHelper.User.UserID)) return;

            object obj = RecordWorkTask.GetNewWorkTaskModle(strKind, MainHelper.User.UserID);
            if (obj == null) {
                MsgBox.ShowWarningMessageBox("出错,未找到对应的模块,请检查模板设置!");
                return;
            }
            LP_Record lpr = new LP_Record();
            lpr.ID = "N" + lpr.CreateID();
            lpr.Kind = strKind;
            lpr.CreateTime = DateTime.Now.ToString();
            if (obj is frmLP) {
                frmLP frm = new frmLP();

                frm.Status = "add";
                frm.Kind = strKind;
                string[] strtemp = RecordWorkTask.RunNewGZPRecord(lpr.ID, strKind, MainHelper.User.UserID, false);

                //frm.ParentTemple = RecordWorkTask.GetNewWorkTaskTemple(strKind, MainHelper.User.UserID);

                //frm.RecordWorkFlowData = RecordWorkTask.GetGZPRecordSartWorkData(ParentObj.FlowCaption, MainHelper.User.UserID);
                frm.RecordWorkFlowData = RecordWorkTask.GetRecordWorkFlowData(lpr.ID, MainHelper.User.UserID);
                if (frm.RecordWorkFlowData == null) {
                    MsgBox.ShowWarningMessageBox("出错,未找到该流程信息,请检查模板设置!");
                }
                frm.ParentTemple = RecordWorkTask.GetWorkTaskTemple(frm.RecordWorkFlowData, lpr);
                if (frm.ParentTemple == null) {
                    MsgBox.ShowWarningMessageBox("出错,未找到该节点关联的表单,请检查模板设置!");
                }
                lpr.Number = RecordWorkTask.CreatWorkFolwNo(MainHelper.UserOrg, frm.ParentTemple.LPID);
                lpr.Status = frm.RecordWorkFlowData.Rows[0]["TaskCaption"].ToString();
                //lpr.Status = "填票";
                //frm.RowData = lpr;
                frm.CurrRecord = lpr;
                MainHelper.PlatformSqlMap.Create<LP_Record>(lpr);
                if (frm.ShowDialog() == DialogResult.OK) {
                    InitData(strSQL);
                }
            } else {


                string[] strtemp = RecordWorkTask.RunNewGZPRecord(lpr.ID, strKind, MainHelper.User.UserID, false);
                if (strtemp[0].IndexOf("未提交至任何人") > -1) {
                    MsgBox.ShowTipMessageBox("未提交至任何人,创建失败,请检查流程模板和组织机构配置是否正确!");
                    return;
                }
                DataTable recordWorkFlowData = RecordWorkTask.GetRecordWorkFlowData(lpr.ID, MainHelper.User.UserID);
                if (recordWorkFlowData == null) {
                    MsgBox.ShowWarningMessageBox("出错,未找到该流程信息,请检查模板设置!");

                }

                lpr.Status = recordWorkFlowData.Rows[0]["TaskCaption"].ToString();
                MainHelper.PlatformSqlMap.Create<LP_Record>(lpr);
                if (obj.GetType().GetProperty("IsWorkflowCall") != null)
                    obj.GetType().GetProperty("IsWorkflowCall").SetValue(obj, true, null);
                else {
                    MsgBox.ShowWarningMessageBox("模块不支持,请咨询开发人员!");
                    return;
                }
                if (obj.GetType().GetProperty("CurrRecord") != null)
                    obj.GetType().GetProperty("CurrRecord").SetValue(obj, lpr, null);
                else {
                    MsgBox.ShowWarningMessageBox("模块不支持,请咨询开发人员!");
                    return;
                }
                if (obj.GetType().GetProperty("RecordWorkFlowData") != null)
                    obj.GetType().GetProperty("RecordWorkFlowData").SetValue(obj, recordWorkFlowData, null);
                else {
                    MsgBox.ShowWarningMessageBox("模块不支持,请咨询开发人员!");
                    return;
                }
                if (obj.GetType().GetProperty("ParentTemple") != null)
                    obj.GetType().GetProperty("ParentTemple").SetValue(obj, RecordWorkTask.GetWorkTaskTemple(recordWorkFlowData, lpr), null);
                else {
                    MsgBox.ShowWarningMessageBox("模块不支持,请咨询开发人员!");
                    return;
                }
                if (obj is UserControl) {
                    FormBase dlg = new FormBase();
                    dlg.Text = ((UserControl)obj).Name;
                    dlg.MdiParent = MainHelper.MainForm;
                    dlg.Controls.Add((UserControl)obj);
                    ((UserControl)obj).Dock = DockStyle.Fill;
                    dlg.Show();
                } else
                    if (obj is Form) {
                        if (obj is frmyxfxWorkFlowEdit) {
                            PJ_03yxfx yxfx = new PJ_03yxfx();
                            yxfx.OrgCode = MainHelper.UserOrg.OrgCode;
                            yxfx.OrgName = MainHelper.UserOrg.OrgName;
                            if (parentObj.FlowCaption.IndexOf("定期分析") > 0)
                                yxfx.type = "定期分析";
                            else
                                if (parentObj.FlowCaption.IndexOf("专题分析") > 0)
                                    yxfx.type = "专题分析";
                            ((frmyxfxWorkFlowEdit)obj).RecordStatus = 0;
                            yxfx.rq = DateTime.Now;
                            ((frmyxfxWorkFlowEdit)obj).RowData = yxfx;

                        } else if (obj is frmsbqxWorkFlowEdit) {
                            PJ_qxfl qxfl = new PJ_qxfl();
                            qxfl.OrgCode = MainHelper.UserOrg.OrgCode;
                            qxfl.OrgName = MainHelper.UserOrg.OrgName;

                            ((frmsbqxWorkFlowEdit)obj).RowData = qxfl;

                        }

                        ((Form)obj).ShowDialog();
                    }
                InitData(strSQL);

            }
            //获得编辑按钮的状态
            this.btEditfrm.Caption = lpr.Status;
        }
Ejemplo n.º 2
0
        void gridViewOperation_AfterAdd(PJ_ccxqjh newobj)
        {
            WF_ModleRecordWorkTaskIns mrwt = new WF_ModleRecordWorkTaskIns();
            if (isWorkflowCall)
            {
                
                mrwt.ModleRecordID = newobj.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 = newobj.GetType().ToString();
                mrwt.WorkTaskInsId = WorkFlowData.Rows[0]["WorkTaskInsId"].ToString();
                mrwt.CreatTime = DateTime.Now;
                MainHelper.PlatformSqlMap.Create<WF_ModleRecordWorkTaskIns>(mrwt);
                //currRecord.DocContent = newobj.BigData;
                //MainHelper.PlatformSqlMap.Update<LP_Record>(currRecord);

            }
            if (newobj.xqlr != "")
            {
                PJ_qxfl qxfj = new PJ_qxfl();
                qxfj.ID = newobj.ID;
                qxfj.CreateDate = DateTime.Now;
                qxfj.CreateMan = MainHelper.User.UserName;
                qxfj.OrgCode = newobj.OrgCode;
                qxfj.OrgName = newobj.OrgName;
                qxfj.qxlb = newobj.qxlb;
                qxfj.qxly = "春检消缺计划";
                qxfj.qxnr = newobj.xqlr;
                MainHelper.PlatformSqlMap.Create<PJ_qxfl>(qxfj);
                //LP_Record lpr = new LP_Record();
                //lpr.ID = "N" + lpr.CreateID();
                //lpr.Kind = "设备缺陷管理流程";
                //lpr.CreateTime = DateTime.Now.ToString();
                //lpr.OrgName = qxfj.OrgName;

                //string[] strtemp = RecordWorkTask.RunNewGZPRecord(lpr.ID, "设备缺陷管理流程", MainHelper.User.UserID, false);
                //if (strtemp[0].IndexOf("未提交至任何人") > -1)
                //{
                //    MsgBox.ShowTipMessageBox("未提交至任何人,创建失败,请检查流程模板和组织机构配置是否正确!");
                //    return;
                //}
                //DataTable recordWorkFlowData = RecordWorkTask.GetRecordWorkFlowData(lpr.ID, MainHelper.User.UserID);
                //if (recordWorkFlowData == null)
                //{
                //    MsgBox.ShowWarningMessageBox("出错,未找到该流程信息,请检查模板设置!");

                //}
                //LP_Temple ParentTemple = RecordWorkTask.GetWorkTaskTemple(recordWorkFlowData, lpr);
                //if (ParentTemple == null)
                //    lpr.Number = RecordWorkTask.CreatWorkFolwNo(MainHelper.UserOrg, "设备缺陷管理流程");
                //else
                //    lpr.Number = RecordWorkTask.CreatWorkFolwNo(MainHelper.UserOrg, ParentTemple.LPID);
                //lpr.Status = recordWorkFlowData.Rows[0]["TaskCaption"].ToString();
                //MainHelper.PlatformSqlMap.Create<LP_Record>(lpr);
                //currRecord = lpr;




                Thread.Sleep(new TimeSpan(100000));//0.1毫秒
                mrwt = new WF_ModleRecordWorkTaskIns();
                mrwt.ID = mrwt.CreateID();
                mrwt.ModleRecordID = qxfj.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 = qxfj.GetType().ToString();
                mrwt.WorkTaskInsId = WorkFlowData.Rows[0]["WorkTaskInsId"].ToString();
                mrwt.CreatTime = DateTime.Now;
                MainHelper.PlatformSqlMap.Create<WF_ModleRecordWorkTaskIns>(mrwt);
            }
        }
Ejemplo n.º 3
0
        //处理缺陷明细  lgmqx
        private void Addqxmx(PJ_yfsyjl obj)
        {
            PJ_qxfl tempobj = MainHelper.PlatformSqlMap.GetOneByKey<PJ_qxfl>(obj.ID);
            switch (_type)
            {
                case "变压器":
                    if (obj.syjg != "合格")
                    {
                        if (tempobj == null || tempobj.xcr == string.Empty)
                        {
                            MainHelper.PlatformSqlMap.DeleteByKey<PJ_qxfl>(obj.ID);
                            PJ_qxfl mx = new PJ_qxfl();
                            mx.ID = obj.ID;
                            mx.OrgCode = obj.OrgCode;
                            mx.OrgName = obj.OrgName;
                            mx.LineID = "01";
                            mx.LineName = obj.sbInstallAdress;
                            mx.xlqd = obj.sbInstallAdress;
                            mx.xssj = obj.sjExpTime;
                            mx.xsr = obj.syMan;
                            mx.qxly = "变压器预防性试验实施情况记录";
                            mx.qxnr = "预防性试验不合格";
                            mx.qxlb = "重大缺陷";
                            mx.xcqx = mx.xssj.AddDays(3).ToShortDateString();

                            //lgmqxlast
                            mx.xlid = obj.xlid;
                            mx.xlname = obj.xlname;
                            mx.tqid = obj.tqid;
                            mx.tqname = obj.tqname;
                            mx.byqid = obj.byqid;
                            mx.byqname = obj.byqname;
                            mx.kgid = obj.kgid;
                            mx.kgname = obj.kgname;
                            MainHelper.PlatformSqlMap.Create<PJ_qxfl>(mx);
                        }

                    }
                    else
                    {
                        if (tempobj != null && tempobj.xcr == string.Empty)
                        {
                            MainHelper.PlatformSqlMap.DeleteByKey<PJ_qxfl>(obj.ID);
                        }

                    }
                    break;
                case "断路器":
                    if (obj.syjg != "合格")
                    {
                        if (tempobj == null || tempobj.xcr == string.Empty)
                        {
                            MainHelper.PlatformSqlMap.DeleteByKey<PJ_qxfl>(obj.ID);
                            PJ_qxfl mx = new PJ_qxfl();
                            mx.ID = obj.ID;
                            mx.OrgCode = obj.OrgCode;
                            mx.OrgName = obj.OrgName;
                            mx.LineID = "02";
                            mx.LineName = obj.sbInstallAdress;
                            mx.xlqd = obj.sbInstallAdress;
                            mx.xssj = obj.sjExpTime;
                            mx.xsr = obj.syMan;
                            mx.qxly = "断路器预防性试验实施情况记录";
                            mx.qxnr = "预防性试验不合格";
                            mx.qxlb = "重大缺陷";
                            mx.xcqx = mx.xssj.AddDays(3).ToShortDateString();

                            //lgmqxlast
                            mx.xlid = obj.xlid;
                            mx.xlname = obj.xlname;
                            mx.tqid = obj.tqid;
                            mx.tqname = obj.tqname;
                            mx.byqid = obj.byqid;
                            mx.byqname = obj.byqname;
                            mx.kgid = obj.kgid;
                            mx.kgname = obj.kgname;
                            MainHelper.PlatformSqlMap.Create<PJ_qxfl>(mx);
                        }
                    }
                    else
                    {
                        if (tempobj != null && tempobj.xcr == string.Empty)
                        {
                            MainHelper.PlatformSqlMap.DeleteByKey<PJ_qxfl>(obj.ID);
                        }

                    }
                    break;

                case "避雷器":

                    if (obj.syjg != "合格")
                    {
                        if (tempobj == null || tempobj.xcr == string.Empty)
                        {
                            MainHelper.PlatformSqlMap.DeleteByKey<PJ_qxfl>(obj.ID);
                            PJ_qxfl mx = new PJ_qxfl();
                            mx.ID = obj.ID;
                            mx.OrgCode = obj.OrgCode;
                            mx.OrgName = obj.OrgName;
                            mx.LineID = "03";
                            mx.LineName = obj.sbInstallAdress;
                            mx.xlqd = obj.sbInstallAdress;
                            mx.xssj = obj.sjExpTime;
                            mx.xsr = obj.syMan;
                            mx.qxly = "避雷器预防性试验实施情况记录";
                            mx.qxnr = "预防性试验不合格";
                            if (obj.syjg == "绝缘阻值低于2000兆欧")
                            {
                                mx.qxnr = "预防性试验不合格";
                                mx.qxlb = "一般缺陷";
                                mx.xcqx = mx.xssj.AddMinutes(3).ToShortDateString();
                            }
                            else if (obj.syjg == "绝缘阻值低于1000兆欧")
                            {
                                mx.qxnr = "预防性试验不合格";
                                mx.qxlb = "重大缺陷";
                                mx.xcqx = mx.xssj.AddDays(3).ToShortDateString();
                            }
                            //lgmqxlast
                            mx.xlid = obj.xlid;
                            mx.xlname = obj.xlname;
                            mx.tqid = obj.tqid;
                            mx.tqname = obj.tqname;
                            mx.byqid = obj.byqid;
                            mx.byqname = obj.byqname;
                            mx.kgid = obj.kgid;
                            mx.kgname = obj.kgname;
                            MainHelper.PlatformSqlMap.Create<PJ_qxfl>(mx);
                        }
                    }
                    else
                    {
                        if (tempobj != null && tempobj.xcr == string.Empty)
                        {
                            MainHelper.PlatformSqlMap.DeleteByKey<PJ_qxfl>(obj.ID);
                        }

                    }
                    break;
                case "电容器":
                    if (obj.syjg != "合格")
                    {
                        if (tempobj == null || tempobj.xcr == string.Empty)
                        {
                            MainHelper.PlatformSqlMap.DeleteByKey<PJ_qxfl>(obj.ID);
                            PJ_qxfl mx = new PJ_qxfl();
                            mx.ID = obj.ID;
                            mx.OrgCode = obj.OrgCode;
                            mx.OrgName = obj.OrgName;
                            mx.LineID = "04";
                            mx.LineName = obj.sbInstallAdress;
                            mx.xlqd = obj.sbInstallAdress;
                            mx.xssj = obj.sjExpTime;
                            mx.xsr = obj.syMan;
                            mx.qxly = "电容器预防性试验实施情况记录";
                            mx.qxnr = "预防性试验不合格";
                            mx.qxlb = "重大缺陷";
                            mx.xcqx = mx.xssj.AddDays(3).ToShortDateString();
                            //lgmqxlast
                            mx.xlid = obj.xlid;
                            mx.xlname = obj.xlname;
                            mx.tqid = obj.tqid;
                            mx.tqname = obj.tqname;
                            mx.byqid = obj.byqid;
                            mx.byqname = obj.byqname;
                            mx.kgid = obj.kgid;
                            mx.kgname = obj.kgname;
                            MainHelper.PlatformSqlMap.Create<PJ_qxfl>(mx);
                        }
                    }
                    else
                    {
                        if (tempobj != null && tempobj.xcr == string.Empty)
                        {
                            MainHelper.PlatformSqlMap.DeleteByKey<PJ_qxfl>(obj.ID);
                        }

                    }
                    break;
            }
        }
Ejemplo n.º 4
0
        void gridViewOperation_AfterAdd(PJ_18gysbpjmx obj) {
            //RefreshData(" where PJ_ID='" + PSObj.PJ_ID + "' order by id desc");
            RefreshData(" where PJ_ID='" + PSObj.PJ_ID + "' order by xh ");

            if (isWorkflowCall) {
                WF_ModleRecordWorkTaskIns mrwt = new WF_ModleRecordWorkTaskIns();
                mrwt.ModleRecordID = obj.PJ_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 = obj.GetType().ToString();
                mrwt.WorkTaskInsId = WorkFlowData.Rows[0]["WorkTaskInsId"].ToString();
                mrwt.CreatTime = DateTime.Now;
                MainHelper.PlatformSqlMap.Create<WF_ModleRecordWorkTaskIns>(mrwt);
                MainHelper.PlatformSqlMap.Update<LP_Record>(currRecord);
                PJ_qxfl qxfj = new PJ_qxfl();
                qxfj.CreateDate = PSObj.CreateDate;
                qxfj.CreateMan = PSObj.CreateMan;
                qxfj.LineID = "";
                qxfj.LineName = "";
                qxfj.OrgCode = PSObj.OrgCode;
                qxfj.OrgName = PSObj.OrgName;
                qxfj.qxlb = obj.qxlb;
                qxfj.qxly = "高压配电设备评级表";
                qxfj.qxnr = obj.qxnr;
                qxfj.xcqx = "";
                qxfj.xcr = "";
                qxfj.xlqd = "";
                qxfj.xsr = "";
                qxfj.xssj = new DateTime(1900, 1, 1);
                MainHelper.PlatformSqlMap.Create<PJ_qxfl>(qxfj);
                LP_Record lpr = new LP_Record();
                lpr.ID = "N" + lpr.CreateID();
                lpr.Kind = "设备缺陷管理流程";
                lpr.CreateTime = DateTime.Now.ToString();
                lpr.OrgName = qxfj.OrgName;

                string[] strtemp = RecordWorkTask.RunNewGZPRecord(lpr.ID, "设备缺陷管理流程", MainHelper.User.UserID, false);
                if (strtemp[0].IndexOf("未提交至任何人") > -1) {
                    MsgBox.ShowTipMessageBox("未提交至任何人,创建失败,请检查流程模板和组织机构配置是否正确!");
                    return;
                }
                DataTable recordWorkFlowData = RecordWorkTask.GetRecordWorkFlowData(lpr.ID, MainHelper.User.UserID);
                if (recordWorkFlowData == null) {
                    MsgBox.ShowWarningMessageBox("出错,未找到该流程信息,请检查模板设置!");

                }
                LP_Temple ParentTemple = RecordWorkTask.GetWorkTaskTemple(recordWorkFlowData, lpr);
                if (ParentTemple == null)
                    lpr.Number = RecordWorkTask.CreatWorkFolwNo(MainHelper.UserOrg, "设备缺陷管理流程");
                else
                    lpr.Number = RecordWorkTask.CreatWorkFolwNo(MainHelper.UserOrg, ParentTemple.LPID);
                lpr.Status = recordWorkFlowData.Rows[0]["TaskCaption"].ToString();
                MainHelper.PlatformSqlMap.Create<LP_Record>(lpr);
                currRecord = lpr;
                WorkFlowData = recordWorkFlowData;



                Thread.Sleep(new TimeSpan(100000));//0.1毫秒
                mrwt = new WF_ModleRecordWorkTaskIns();
                mrwt.ID = mrwt.CreateID();
                mrwt.ModleRecordID = qxfj.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 = qxfj.GetType().ToString();
                mrwt.WorkTaskInsId = WorkFlowData.Rows[0]["WorkTaskInsId"].ToString();
                mrwt.CreatTime = DateTime.Now;
                MainHelper.PlatformSqlMap.Create<WF_ModleRecordWorkTaskIns>(mrwt);
            }
        }
Ejemplo n.º 5
0
 private void frmsbqxWorkFlowEdit_Load(object sender, EventArgs e) {
     if (rowData == null) {
         rowData = new PJ_qxfl();
     }
     //InitComboBoxData();
 }
Ejemplo n.º 6
0
        private void btnOK_Click(object sender, EventArgs e) {
            PJ_06sbxsmx sbxs = RowData as PJ_06sbxsmx;
            string strmes = "";
            object obj = MainHelper.PlatformSqlMap.GetOneByKey<PJ_06sbxsmx>(sbxs.ID);
            PJ_qxfl qxfj = new PJ_qxfl();
            if (obj == null) {
                obj = MainHelper.PlatformSqlMap.GetOne<PJ_06sbxs>("where  OrgCode='" + sbxs.OrgCode + "' and  LineID='" + sbxs.LineID + "' and xlqd='" + sbxs.xlqd + "'");
                if (obj == null) {
                    PJ_06sbxs sbxstemp = new PJ_06sbxs();
                    sbxstemp.OrgCode = sbxs.OrgCode;
                    sbxstemp.OrgName = sbxs.OrgName;
                    sbxstemp.LineID = sbxs.LineID;
                    sbxstemp.LineName = sbxs.LineName;
                    sbxstemp.xlqd = sbxs.xlqd;
                    sbxstemp.xsr = sbxs.xsr;
                    sbxstemp.xssj = DateTime.Now;
                    sbxstemp.CreateMan = MainHelper.User.UserName;
                    MainHelper.PlatformSqlMap.Create<PJ_06sbxs>(sbxstemp);
                    sbxs.ParentID = sbxstemp.ID;
                } else {
                    sbxs.ParentID = (obj as PJ_06sbxs).ID;
                }

                MainHelper.PlatformSqlMap.Create<PJ_06sbxsmx>(sbxs);
                //WF_ModleRecordWorkTaskIns mrwt = new WF_ModleRecordWorkTaskIns();
                //mrwt.ModleRecordID = sbxs.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 = sbxs.GetType().ToString();
                //mrwt.WorkTaskInsId = WorkFlowData.Rows[0]["WorkTaskInsId"].ToString();
                //mrwt.CreatTime = DateTime.Now;
                //MainHelper.PlatformSqlMap.Create<WF_ModleRecordWorkTaskIns>(mrwt);
                if (sbxs.qxlb != "") {


                    qxfj.CreateDate = sbxs.CreateDate;
                    qxfj.CreateMan = sbxs.CreateMan;
                    qxfj.LineID = sbxs.LineID;
                    qxfj.LineName = sbxs.LineName;
                    qxfj.OrgCode = sbxs.OrgCode;
                    qxfj.OrgName = sbxs.OrgName;
                    qxfj.qxlb = sbxs.qxlb;
                    qxfj.qxly = "设备巡视";
                    qxfj.qxnr = sbxs.qxnr;
                    qxfj.xcqx = sbxs.xcqx;
                    qxfj.xcr = sbxs.xcr;
                    qxfj.xlqd = sbxs.xlqd;
                    qxfj.xsr = sbxs.xsr;
                    qxfj.xssj = sbxs.xssj;
                    MainHelper.PlatformSqlMap.Create<PJ_qxfl>(qxfj);
                }
            } else {
                PJ_qxfl qxfltemp = MainHelper.PlatformSqlMap.GetOne<PJ_qxfl>(" where CONVERT(varchar, CreateDate, 120 ) =  '" + sbxs.CreateDate + "'"
                  + " and LineID='" + sbxs.LineID + "'"
                  + " and OrgCode='" + sbxs.OrgCode + "'"
                   + " and qxlb='" + sbxs.qxlb + "'"
                   + " and xsr='" + sbxs.xsr + "'"
                   + " and xlqd='" + sbxs.xlqd + "'"
                  );
                if (qxfltemp != null) {
                    qxfltemp.LineID = sbxs.LineID;
                    qxfltemp.LineName = sbxs.LineName;
                    qxfltemp.OrgCode = sbxs.OrgCode;
                    qxfltemp.OrgName = sbxs.OrgName;
                    qxfltemp.qxlb = sbxs.qxlb;
                    qxfltemp.qxnr = sbxs.qxnr;
                    qxfltemp.xssj = sbxs.xssj;
                    qxfltemp.xsr = sbxs.xsr;
                    qxfltemp.xcqx = sbxs.xcqx;
                    qxfltemp.xlqd = sbxs.xlqd; ;
                    qxfltemp.xcr = sbxs.xcr;
                    qxfltemp.xcrq = sbxs.xcrq;
                    MainHelper.PlatformSqlMap.Update<PJ_qxfl>(qxfltemp);
                }
                MainHelper.PlatformSqlMap.Update<PJ_06sbxsmx>(sbxs);
            }


            currRecord.LastChangeTime = DateTime.Now.ToString();
            if (RecordWorkTask.CheckOnRiZhi(WorkFlowData)) {

                RecordWorkTask.CreatRiZhi(WorkFlowData, null, currRecord.ID, new object[] { sbxs, qxfj, 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];
            }

            currRecord.LastChangeTime = DateTime.Now.ToString();
            if (currRecord.ImageAttachment == null) currRecord.ImageAttachment = new byte[0];
            if (currRecord.SignImg == null) currRecord.SignImg = new byte[0];
            MainHelper.PlatformSqlMap.Update("UpdateLP_Record", currRecord);
            //if (obj == null ) {//&& (sbxs.qxlb != "")
            //    DataTable dttemp = RecordWorkTask.GetRecordWorkFlowData(currRecord.ID);
            //    if (dttemp.Rows.Count > 0) {
            //        Thread.Sleep(new TimeSpan(100000));//0.1毫秒
            //        WF_ModleRecordWorkTaskIns mrwt = new WF_ModleRecordWorkTaskIns();
            //        mrwt.ID = mrwt.CreateID();
            //        mrwt.ModleRecordID = sbxs.ID;
            //        mrwt.RecordID = currRecord.ID;
            //        mrwt.WorkFlowId = dttemp.Rows[0]["WorkFlowId"].ToString();
            //        mrwt.WorkFlowInsId = dttemp.Rows[0]["WorkFlowInsId"].ToString();
            //        mrwt.WorkTaskId = dttemp.Rows[0]["WorkTaskId"].ToString();
            //        mrwt.ModleTableName = sbxs.GetType().ToString();
            //        mrwt.WorkTaskInsId = dttemp.Rows[0]["WorkTaskInsId"].ToString();
            //        mrwt.CreatTime = DateTime.Now;
            //        MainHelper.PlatformSqlMap.Create<WF_ModleRecordWorkTaskIns>(mrwt);
            //    }

            //}
        }
Ejemplo n.º 7
0
        //处理缺陷明细  lgmqx
        private void Addqxmx(PJ_07jdzzjl obj)
        {
            PJ_qxfl tempobj = MainHelper.PlatformSqlMap.GetOneByKey<PJ_qxfl>(obj.ID);
            if (obj.jr != "合格")
            {
                if (tempobj == null || tempobj.xcr == string.Empty)
                {
                    MainHelper.PlatformSqlMap.DeleteByKey<PJ_qxfl>(obj.ID);
                    PJ_qxfl mx = new PJ_qxfl();
                    mx.ID = obj.ID;
                    mx.OrgCode = parentObj.OrgCode;
                    mx.OrgName = parentObj.OrgName;
                    mx.LineID = "05";
                    mx.LineName = parentObj.LineName;
                    mx.xlqd = parentObj.gth;
                    mx.xssj = obj.clrq;
                    mx.xsr = obj.jcr;
                    mx.qxly = "接地装置检测记录";
                    mx.qxnr = "接地电阻检测不合格";
                    mx.qxlb = "一般缺陷";
                    mx.xcqx = mx.xssj.AddMinutes(3).ToShortDateString();

                    //lgmqxlast
                    mx.xlid = obj.xlid;
                    mx.xlname = obj.xlname;
                    mx.tqid = obj.tqid;
                    mx.tqname = obj.tqname;
                    mx.byqid = obj.byqid;
                    mx.byqname = obj.byqname;
                    mx.kgid = obj.kgid;
                    mx.kgname = obj.kgname;

                    MainHelper.PlatformSqlMap.Create<PJ_qxfl>(mx);
                }

            }
            else
            {
                if (tempobj != null && tempobj.xcr == string.Empty)
                {
                    MainHelper.PlatformSqlMap.DeleteByKey<PJ_qxfl>(obj.ID);
                }

            }
                 
        }
Ejemplo n.º 8
0
        /// <summary>
        /// 打开节点窗口
        /// </summary>
        /// <param name="currRecord"></param>
        /// <param name="dtret"></param>
        private void workFlowFormShow(LP_Record currRecord, DataTable dtret)
        {
            DataTable dtall = RecordWorkTask.GetRecordWorkFlowData(currRecord.ID, MainHelper.User.UserID);
            DataTable dt = new DataTable();
            if (dtret == null)
            {
                if (dtall.Rows.Count < 1)
                {
                    if (currRecord.Status == "存档")
                    {
                        frmTemplate fm = new frmTemplate();
                        fm.ParentTemple = RecordWorkTask.GetWorkTaskTemple(dt, currRecord);
                        fm.CurrRecord = currRecord;
                        fm.Kind = strKind;
                        fm.Status = "edit";
                        fm.ShowDialog();
                    }
                    else
                    {
                        IList<WFP_RecordWorkTaskIns> wf = MainHelper.PlatformSqlMap.GetList<WFP_RecordWorkTaskIns>("SelectWFP_RecordWorkTaskInsList", "where RecordID='" + currRecord.ID + "'");
                        if (wf.Count > 0)
                        {
                            WF_WorkFlowInstance wfi = MainHelper.PlatformSqlMap.GetOneByKey<WF_WorkFlowInstance>(wf[0].WorkFlowInsId);

                            string struser = RecordWorkTask.GetWorkFlowTaskOperator(wf[0].WorkTaskInsId);
                            MsgBox.ShowTipMessageBox("没有操作此记录的权限,此记录操作者为 " + struser + " !");
                        }
                    }
                    return;
                }
                if (dtall.Rows.Count == 1 || currRecord.Status.IndexOf("|") == -1)
                {
                    dt = dtall;
                }
                else
                {
                    WorkFlowTaskSelectForm wfts = new WorkFlowTaskSelectForm();
                    wfts.RecordWorkFlowData = dtall;
                    if (wfts.ShowDialog() == DialogResult.OK)
                    {
                        dt = wfts.RetWorkFlowData;
                    }
                    else
                    {
                        return;
                    }
                }
            }
            else
            {
                dt = dtret;
            }
            if (!RecordWorkTask.HaveRunRecordRole(currRecord.ID, MainHelper.User.UserID)) return;
            object obj = RecordWorkTask.GetWorkTaskModle(dt);
            if (obj == null)
            {
                return;
            }

            if (obj is frmLP)
            {
                frmLP frm = new frmLP();
                //frm.Status = "edit";
                frm.Status = RecordWorkTask.GetWorkTaskStatus(dt, currRecord);

                frm.CurrRecord = currRecord;
                frm.strxiestatus = "edit";

                frm.ParentTemple = RecordWorkTask.GetWorkTaskTemple(dt, currRecord);
                if (frm.ParentTemple == null)
                {
                    MsgBox.ShowWarningMessageBox("出错,未找到该节点关联的表单,请检查模板设置!");
                    //return;
                }

                frm.Kind = strKind;
                frm.RecordWorkFlowData = dt;
                if (frm.ShowDialog() == DialogResult.OK)
                {
                    InitData(strKind);
                }
            }
            else
            {
                LP_Temple lp = RecordWorkTask.GetWorkTaskTemple(dt, currRecord);
                object readObj = null;
                if (obj.GetType().GetProperty("IsWorkflowCall") != null)
                    obj.GetType().GetProperty("IsWorkflowCall").SetValue(obj, true, null);
                else
                {
                    MsgBox.ShowWarningMessageBox("模块不支持IsWorkflowCall,请咨询开发人员!");
                    return;
                }
                if (obj.GetType().GetProperty("CurrRecord") != null)
                    obj.GetType().GetProperty("CurrRecord").SetValue(obj, currRecord, null);
                else
                {
                    MsgBox.ShowWarningMessageBox("模块不支持CurrRecord,请咨询开发人员!");
                    return;
                }


                if (obj.GetType().GetProperty("ParentTemple") != null)
                    obj.GetType().GetProperty("ParentTemple").SetValue(obj, RecordWorkTask.GetWorkTaskTemple(dt, currRecord), null);
                else
                {
                    MsgBox.ShowWarningMessageBox("模块不支持ParentTemple,请咨询开发人员!");
                    return;
                }

                if (obj.GetType().GetProperty("RecordWorkFlowData") != null)
                    obj.GetType().GetProperty("RecordWorkFlowData").SetValue(obj, dt, null);
                else
                {
                    MsgBox.ShowWarningMessageBox("模块不支持RecordWorkFlowData,请咨询开发人员!");
                    return;
                }
                if (obj is UserControl)
                {

                    FormBase dlg = new FormBase();
                    dlg.Text = ((UserControl)obj).Name;
                    dlg.MdiParent = MainHelper.MainForm;
                    dlg.Controls.Add((UserControl)obj);
                    ((UserControl)obj).Dock = DockStyle.Fill;
                    dlg.Show();
                }
                else
                    if (obj is Form)
                    {
                        if (obj is frmyxfxWorkFlowEdit)
                        {
                            IList<WF_ModleRecordWorkTaskIns> li = MainHelper.PlatformSqlMap.GetListByWhere<WF_ModleRecordWorkTaskIns>(" where RecordID='" + currRecord.ID + "'"
                             + " and  WorkFlowId='" + dt.Rows[0]["WorkFlowId"].ToString() + "' and ModleTableName='Ebada.Scgl.Model.PJ_03yxfx'"
                               + " and  WorkFlowInsId='" + dt.Rows[0]["WorkFlowInsId"].ToString() + "' order by CreatTime desc");
                            PJ_03yxfx yxfx = new PJ_03yxfx();
                            if (li.Count > 0)
                            {
                                yxfx = MainHelper.PlatformSqlMap.GetOneByKey<PJ_03yxfx>(li[0].ModleRecordID);

                            }
                            else
                            {
                                yxfx = new PJ_03yxfx();
                                yxfx.OrgCode = MainHelper.UserOrg.OrgCode;
                                yxfx.OrgName = MainHelper.UserOrg.OrgName;
                                if (parentObj.FlowCaption.IndexOf("定期分析") > 0)
                                    yxfx.type = "定期分析";
                                else
                                    if (parentObj.FlowCaption.IndexOf("专题分析") > 0)
                                        yxfx.type = "专题分析";
                                ((frmyxfxWorkFlowEdit)obj).RecordStatus = 0;
                                yxfx.rq = DateTime.Now;
                                ((frmyxfxWorkFlowEdit)obj).RowData = yxfx;
                                readObj = yxfx;
                            }
                            switch (dt.Rows[0]["TaskInsCaption"].ToString())
                            {
                                case "填写":
                                    ((frmyxfxWorkFlowEdit)obj).RecordStatus = 0;
                                    break;
                                case "领导检查":
                                    ((frmyxfxWorkFlowEdit)obj).RecordStatus = 1;
                                    break;
                                case "检查人检查":
                                    ((frmyxfxWorkFlowEdit)obj).RecordStatus = 2;
                                    break;

                            }
                            yxfx.rq = DateTime.Now;
                            ((frmyxfxWorkFlowEdit)obj).RowData = yxfx;

                        }
                        else if (obj is frmsbqxWorkFlowEdit)
                        {
                            IList<WF_ModleRecordWorkTaskIns> li = MainHelper.PlatformSqlMap.GetListByWhere<WF_ModleRecordWorkTaskIns>(" where RecordID='" + currRecord.ID + "'"
                             + " and (ModleTableName='Ebada.Scgl.Model.PJ_qxfl' or ModleTableName='Ebada.Scgl.Model.PJ_06sbxsmx')"
                               + " order by CreatTime desc");
                            PJ_qxfl qxfl = new PJ_qxfl();
                            if (li.Count > 0)
                            {
                                //qxfl = MainHelper.PlatformSqlMap.GetOneByKey<PJ_qxfl>(li[0].ModleRecordID);
                                //PJ_06sbxsmx qxfltemp = MainHelper.PlatformSqlMap.GetOneByKey<PJ_06sbxsmx>(li[0].ModleRecordID);
                                PJ_qxfl qxfltemp2 = MainHelper.PlatformSqlMap.GetOneByKey<PJ_qxfl>(li[0].ModleRecordID);
                                if (qxfltemp2 != null) qxfl = qxfltemp2;
                                //qxfl.CreateDate = qxfltemp.CreateDate;
                                //qxfl.LineID = qxfltemp.LineID;
                                //qxfl.LineName = qxfltemp.LineName;
                                //qxfl.OrgCode = qxfltemp.OrgCode;
                                //qxfl.OrgName = qxfltemp.OrgName;
                                //qxfl.qxlb = qxfltemp.qxlb;
                                //qxfl.qxnr = qxfltemp.qxnr;
                                //qxfl.xssj = qxfltemp.xssj;
                                //qxfl.xsr = qxfltemp.xsr;
                                //qxfl.xcqx = qxfltemp.xcqx;
                                //qxfl.xlqd = qxfltemp.xlqd;
                                //qxfl.CreateDate = DateTime.Now;
                                //qxfl.CreateMan = MainHelper.User.UserName;
                            }
                            else
                            {
                                qxfl = new PJ_qxfl();
                                qxfl.OrgCode = MainHelper.UserOrg.OrgCode;
                                qxfl.OrgName = MainHelper.UserOrg.OrgName;
                                qxfl.xssj = DateTime.Today;
                                qxfl.CreateMan = MainHelper.User.UserName;
                                readObj = qxfl;
                            }

                            ((frmsbqxWorkFlowEdit)obj).RowData = qxfl;

                        }
                        else if (obj is frmWorkFlow06sbxsEdit)
                        {
                            IList<WF_ModleRecordWorkTaskIns> li = MainHelper.PlatformSqlMap.GetListByWhere<WF_ModleRecordWorkTaskIns>(" where RecordID='" + currRecord.ID + "'"
                              + "  and (ModleTableName='Ebada.Scgl.Model.PJ_qxfl' or ModleTableName='Ebada.Scgl.Model.PJ_06sbxsmx' )"
                                + "  order by CreatTime desc");
                            PJ_06sbxsmx qxfl = new PJ_06sbxsmx();
                            if (li.Count > 0)
                            {
                                PJ_06sbxsmx qxfltemp = MainHelper.PlatformSqlMap.GetOneByKey<PJ_06sbxsmx>(li[0].ModleRecordID);
                                if (qxfltemp != null) qxfl = qxfltemp;
                                else
                                {

                                    //qxfl = qxfltemp;
                                    //if (qxfl == null) {
                                    //    qxfl = new PJ_06sbxsmx();
                                    //    qxfl.CreateDate = qxfltemp.CreateDate;
                                    //    qxfl.LineID = qxfltemp.LineID;
                                    //    qxfl.LineName = qxfltemp.LineName;
                                    //    qxfl.OrgCode = qxfltemp.OrgCode;
                                    //    qxfl.OrgName = qxfltemp.OrgName;
                                    //    qxfl.qxlb = qxfltemp.qxlb;
                                    //    qxfl.qxnr = qxfltemp.qxnr;
                                    //    qxfl.xssj = qxfltemp.xssj;
                                    //    qxfl.xsr = qxfltemp.xsr;
                                    //    qxfl.xcqx = qxfltemp.xcqx;
                                    //    qxfl.xlqd = qxfltemp.xlqd;
                                    //    qxfl.CreateDate = DateTime.Now;
                                    //    qxfl.CreateMan = MainHelper.User.UserName;
                                    //MainHelper.PlatformSqlMap.Create<PJ_06sbxs>(qxfl);

                                    //WF_ModleRecordWorkTaskIns mrwt = new WF_ModleRecordWorkTaskIns();
                                    //mrwt.ModleRecordID = qxfl.ID;
                                    //mrwt.RecordID = lpr.ID;
                                    //mrwt.WorkFlowId = recordWorkFlowData.Rows[0]["WorkFlowId"].ToString();
                                    //mrwt.WorkFlowInsId = recordWorkFlowData.Rows[0]["WorkFlowInsId"].ToString();
                                    //mrwt.WorkTaskId = recordWorkFlowData.Rows[0]["WorkTaskId"].ToString();
                                    //mrwt.ModleTableName = qxfl.GetType().ToString();
                                    //mrwt.WorkTaskInsId = recordWorkFlowData.Rows[0]["WorkTaskInsId"].ToString();
                                    //mrwt.CreatTime = DateTime.Now;
                                    //MainHelper.PlatformSqlMap.Create<WF_ModleRecordWorkTaskIns>(mrwt);
                                    //}
                                }
                            }
                            else
                            {
                                qxfl = new PJ_06sbxsmx();
                                qxfl.OrgCode = MainHelper.UserOrg.OrgCode;
                                qxfl.OrgName = MainHelper.UserOrg.OrgName;
                                qxfl.CreateDate = DateTime.Now;
                                qxfl.CreateMan = MainHelper.User.UserName;
                                MainHelper.PlatformSqlMap.Create<PJ_06sbxs>(qxfl);

                                WF_ModleRecordWorkTaskIns mrwt = new WF_ModleRecordWorkTaskIns();
                                mrwt.ModleRecordID = qxfl.ID;
                                mrwt.RecordID = currRecord.ID;
                                mrwt.WorkFlowId = dt.Rows[0]["WorkFlowId"].ToString();
                                mrwt.WorkFlowInsId = dt.Rows[0]["WorkFlowInsId"].ToString();
                                mrwt.WorkTaskId = dt.Rows[0]["WorkTaskId"].ToString();
                                mrwt.ModleTableName = qxfl.GetType().ToString();
                                mrwt.WorkTaskInsId = dt.Rows[0]["WorkTaskInsId"].ToString();
                                mrwt.CreatTime = DateTime.Now;
                                MainHelper.PlatformSqlMap.Create<WF_ModleRecordWorkTaskIns>(mrwt);
                                readObj = qxfl;
                            }


                            ((frmWorkFlow06sbxsEdit)obj).RowData = qxfl;

                        }
                        else if (obj is frm08SBTDJXWorkFlowEdit)
                        {
                            IList<WF_ModleRecordWorkTaskIns> li = MainHelper.PlatformSqlMap.GetListByWhere<WF_ModleRecordWorkTaskIns>(" where RecordID='" + currRecord.ID + "'"
                             + " and  WorkFlowId='" + dt.Rows[0]["WorkFlowId"].ToString() + "' and ModleTableName='Ebada.Scgl.Model.PJ_qxfl'"
                               + " and  WorkFlowInsId='" + dt.Rows[0]["WorkFlowInsId"].ToString() + "' order by CreatTime desc");
                            PJ_08sbtdjx qxfl = new PJ_08sbtdjx();
                            if (li.Count > 0)
                            {
                                PJ_qxfl qxfltemp = MainHelper.PlatformSqlMap.GetOneByKey<PJ_qxfl>(li[0].ModleRecordID);
                                li = MainHelper.PlatformSqlMap.GetListByWhere<WF_ModleRecordWorkTaskIns>(" where RecordID='" + currRecord.ID + "'"
                               + " and  WorkFlowId='" + dt.Rows[0]["WorkFlowId"].ToString() + "' and ModleTableName='Ebada.Scgl.Model.PJ_08sbtdjx'"
                                 + " and  WorkFlowInsId='" + dt.Rows[0]["WorkFlowInsId"].ToString() + "' order by CreatTime desc");
                                if (li.Count > 0)
                                {
                                    qxfl = MainHelper.PlatformSqlMap.GetOneByKey<PJ_08sbtdjx>(li[0].ModleRecordID);
                                    readObj = qxfl;
                                }
                                else
                                {
                                    qxfl.OrgCode = qxfltemp.OrgCode;
                                    qxfl.OrgName = qxfltemp.OrgName;
                                    qxfl.LineID = qxfltemp.LineID;
                                    qxfl.LineName = qxfltemp.LineName;
                                    qxfl.jxnr = qxfltemp.qxnr;
                                    if (qxfltemp.qxlb == "紧急缺陷")
                                    {
                                        qxfl.tdxz = "事故停电";
                                    }
                                    else
                                        if (qxfltemp.qxlb == "重大缺陷")
                                        {
                                            qxfl.tdxz = "临时停电";
                                        }
                                        else
                                            if (qxfltemp.qxlb == "一般缺陷")
                                            {
                                                qxfl.tdxz = "一般缺陷";
                                            }
                                    qxfl.CreateDate = DateTime.Now;
                                    qxfl.CreateMan = MainHelper.User.UserName;
                                    MainHelper.PlatformSqlMap.Create<PJ_08sbtdjx>(qxfl);

                                    WF_ModleRecordWorkTaskIns mrwt = new WF_ModleRecordWorkTaskIns();
                                    mrwt.ModleRecordID = qxfl.ID;
                                    mrwt.RecordID = currRecord.ID;
                                    mrwt.WorkFlowId = dt.Rows[0]["WorkFlowId"].ToString();
                                    mrwt.WorkFlowInsId = dt.Rows[0]["WorkFlowInsId"].ToString();
                                    mrwt.WorkTaskId = dt.Rows[0]["WorkTaskId"].ToString();
                                    mrwt.ModleTableName = qxfl.GetType().ToString();
                                    mrwt.WorkTaskInsId = dt.Rows[0]["WorkTaskInsId"].ToString();
                                    mrwt.CreatTime = DateTime.Now;
                                    MainHelper.PlatformSqlMap.Create<WF_ModleRecordWorkTaskIns>(mrwt);
                                    readObj = qxfl;
                                }

                            }
                            else
                            {
                                qxfl = new PJ_08sbtdjx();
                                qxfl.OrgCode = MainHelper.UserOrg.OrgCode;
                                qxfl.OrgName = MainHelper.UserOrg.OrgName;
                                qxfl.CreateDate = DateTime.Now;
                                string str = " where RecordID='" + currRecord.ID + "'"
                             + " and  FieldName='类别' order by id";
                                WF_TableFieldValue mrv = MainHelper.PlatformSqlMap.GetOne<WF_TableFieldValue>(str
                                 );
                                //qxfl = new PJ_24();
                                if (mrv != null)
                                {
                                    qxfl.tdxz = mrv.ControlValue;
                                }
                                MainHelper.PlatformSqlMap.Create<PJ_08sbtdjx>(qxfl);

                                WF_ModleRecordWorkTaskIns mrwt = new WF_ModleRecordWorkTaskIns();
                                mrwt.ModleRecordID = qxfl.ID;
                                mrwt.RecordID = currRecord.ID;
                                mrwt.WorkFlowId = dt.Rows[0]["WorkFlowId"].ToString();
                                mrwt.WorkFlowInsId = dt.Rows[0]["WorkFlowInsId"].ToString();
                                mrwt.WorkTaskId = dt.Rows[0]["WorkTaskId"].ToString();
                                mrwt.ModleTableName = qxfl.GetType().ToString();
                                mrwt.WorkTaskInsId = dt.Rows[0]["WorkTaskInsId"].ToString();
                                mrwt.CreatTime = DateTime.Now;
                                MainHelper.PlatformSqlMap.Create<WF_ModleRecordWorkTaskIns>(mrwt);
                                readObj = qxfl;
                            }

                            ((frm08SBTDJXWorkFlowEdit)obj).RowData = qxfl;

                        }
                        else if (obj is frmsgzaycWorkFlowEdit)
                        {
                            PJ_04sgzayc qxfl = null;
                            IList<WF_ModleRecordWorkTaskIns> li = MainHelper.PlatformSqlMap.GetListByWhere<WF_ModleRecordWorkTaskIns>(" where RecordID='" + currRecord.ID + "'"
                             + "  and ModleTableName='Ebada.Scgl.Model.PJ_04sgzayc'"
                               + "  order by CreatTime desc");

                            if (li.Count > 0)
                            {
                                qxfl = MainHelper.PlatformSqlMap.GetOneByKey<PJ_04sgzayc>(li[0].ModleRecordID);
                            }
                            if (qxfl == null)
                            {
                                li = MainHelper.PlatformSqlMap.GetListByWhere<WF_ModleRecordWorkTaskIns>(" where RecordID='" + currRecord.ID + "'"
                                 + "  and ModleTableName='Ebada.Scgl.Model.PJ_08sbtdjx'"
                                   + " order by CreatTime desc");
                                qxfl = new PJ_04sgzayc();
                                if (li.Count > 0)
                                {
                                    PJ_08sbtdjx qxfltemp = MainHelper.PlatformSqlMap.GetOneByKey<PJ_08sbtdjx>(li[0].ModleRecordID);

                                    qxfl = MainHelper.PlatformSqlMap.GetOneByKey<PJ_04sgzayc>(li[0].ModleRecordID);
                                    if (qxfl == null)
                                    {
                                        qxfl = new PJ_04sgzayc();
                                        qxfl.OrgCode = qxfltemp.OrgCode;
                                        qxfl.OrgName = qxfltemp.OrgName;
                                        qxfl.sdsj = qxfltemp.sdsj;
                                        qxfl.tdsj = qxfltemp.tdsj;
                                        qxfl.gtdsj = "";
                                        TimeSpan span = qxfl.sdsj.Subtract(qxfl.tdsj);
                                        if (span.Days > 0)
                                            qxfl.gtdsj += span.Days + "天";
                                        if (span.Hours > 0)
                                            qxfl.gtdsj += span.Hours + "时";
                                        if (span.Minutes > -1)
                                            qxfl.gtdsj += span.Minutes + "分";
                                        qxfl.fsdd = qxfltemp.jxnr;
                                        qxfl.CreateDate = DateTime.Now; qxfl.ID = qxfl.ID;
                                        qxfl.CreateMan = MainHelper.User.UserName;
                                        MainHelper.PlatformSqlMap.Create<PJ_04sgzayc>(qxfl);

                                        WF_ModleRecordWorkTaskIns mrwt = new WF_ModleRecordWorkTaskIns();
                                        mrwt.ModleRecordID = qxfl.ID;
                                        mrwt.RecordID = currRecord.ID;
                                        mrwt.WorkFlowId = dt.Rows[0]["WorkFlowId"].ToString();
                                        mrwt.WorkFlowInsId = dt.Rows[0]["WorkFlowInsId"].ToString();
                                        mrwt.WorkTaskId = dt.Rows[0]["WorkTaskId"].ToString();
                                        mrwt.ModleTableName = qxfl.GetType().ToString();
                                        mrwt.WorkTaskInsId = dt.Rows[0]["WorkTaskInsId"].ToString();
                                        mrwt.CreatTime = DateTime.Now;
                                        MainHelper.PlatformSqlMap.Create<WF_ModleRecordWorkTaskIns>(mrwt);
                                        readObj = qxfl;
                                    }
                                }
                                else
                                {
                                    qxfl = new PJ_04sgzayc();
                                    qxfl.OrgCode = MainHelper.UserOrg.OrgCode;
                                    qxfl.OrgName = MainHelper.UserOrg.OrgName;
                                    qxfl.CreateMan = MainHelper.User.UserName;
                                    MainHelper.PlatformSqlMap.Create<PJ_04sgzayc>(qxfl);

                                    WF_ModleRecordWorkTaskIns mrwt = new WF_ModleRecordWorkTaskIns();
                                    mrwt.ModleRecordID = qxfl.ID;
                                    mrwt.RecordID = currRecord.ID;
                                    mrwt.WorkFlowId = dt.Rows[0]["WorkFlowId"].ToString();
                                    mrwt.WorkFlowInsId = dt.Rows[0]["WorkFlowInsId"].ToString();
                                    mrwt.WorkTaskId = dt.Rows[0]["WorkTaskId"].ToString();
                                    mrwt.ModleTableName = qxfl.GetType().ToString();
                                    mrwt.WorkTaskInsId = dt.Rows[0]["WorkTaskInsId"].ToString();
                                    mrwt.CreatTime = DateTime.Now;
                                    MainHelper.PlatformSqlMap.Create<WF_ModleRecordWorkTaskIns>(mrwt);
                                    readObj = qxfl;
                                }
                            }
                            ((frmsgzaycWorkFlowEdit)obj).RowData = qxfl;

                        }
                        else if (obj is frmTDJHWorkFlowEdit)
                        {
                            IList<WF_ModleRecordWorkTaskIns> li = MainHelper.PlatformSqlMap.GetListByWhere<WF_ModleRecordWorkTaskIns>(" where RecordID='" + currRecord.ID + "'"
                             + " and  WorkFlowId='" + dt.Rows[0]["WorkFlowId"].ToString() + "' and ModleTableName='Ebada.Scgl.Model.PJ_tdjh'"
                               + " and  WorkFlowInsId='" + dt.Rows[0]["WorkFlowInsId"].ToString() + "' order by CreatTime desc");
                            PJ_tdjh qxfl = new PJ_tdjh();
                            if (li.Count > 0)
                            {
                                qxfl = MainHelper.PlatformSqlMap.GetOneByKey<PJ_tdjh>(li[0].ModleRecordID);

                            }
                            else
                            {
                                li = MainHelper.PlatformSqlMap.GetListByWhere<WF_ModleRecordWorkTaskIns>(" where RecordID='" + currRecord.ID + "'"
                             + " and  WorkFlowId='" + dt.Rows[0]["WorkFlowId"].ToString() + "' and ModleTableName='Ebada.Scgl.Model.PJ_qxfl'"
                               + " and  WorkFlowInsId='" + dt.Rows[0]["WorkFlowInsId"].ToString() + "' order by CreatTime desc");
                                qxfl = new PJ_tdjh();
                                if (li.Count > 0)
                                {
                                    PJ_qxfl qxfltemp = MainHelper.PlatformSqlMap.GetOneByKey<PJ_qxfl>(li[0].ModleRecordID);
                                    qxfl.OrgCode = qxfltemp.OrgCode;
                                    qxfl.SQOrgname = qxfltemp.OrgName;
                                    qxfl.OrgName = qxfltemp.OrgName;
                                    qxfl.JXNR = qxfltemp.qxnr;
                                    qxfl.S1 = "缺陷管理流程";
                                }
                                else
                                {
                                    qxfl.OrgCode = MainHelper.UserOrg.OrgCode;
                                    qxfl.OrgName = MainHelper.UserOrg.OrgName;
                                }
                                MainHelper.PlatformSqlMap.Create<PJ_tdjh>(qxfl);

                                WF_ModleRecordWorkTaskIns mrwt = new WF_ModleRecordWorkTaskIns();
                                mrwt.ModleRecordID = qxfl.ID;
                                mrwt.RecordID = currRecord.ID;
                                mrwt.WorkFlowId = dt.Rows[0]["WorkFlowId"].ToString();
                                mrwt.WorkFlowInsId = dt.Rows[0]["WorkFlowInsId"].ToString();
                                mrwt.WorkTaskId = dt.Rows[0]["WorkTaskId"].ToString();
                                mrwt.ModleTableName = qxfl.GetType().ToString();
                                mrwt.WorkTaskInsId = dt.Rows[0]["WorkTaskInsId"].ToString();
                                mrwt.CreatTime = DateTime.Now;
                                MainHelper.PlatformSqlMap.Create<WF_ModleRecordWorkTaskIns>(mrwt);
                                readObj = qxfl;
                            }

                            ((frmTDJHWorkFlowEdit)obj).RowData = qxfl;

                        }
                        else if (obj is frm24WorkFlowEdit)
                        {
                            IList<WF_ModleRecordWorkTaskIns> li = MainHelper.PlatformSqlMap.GetListByWhere<WF_ModleRecordWorkTaskIns>(" where RecordID='" + currRecord.ID + "'"
                             + " and  WorkFlowId='" + dt.Rows[0]["WorkFlowId"].ToString() + "' and ModleTableName='Ebada.Scgl.Model.PJ_24'"
                               + " and  WorkFlowInsId='" + dt.Rows[0]["WorkFlowInsId"].ToString() + "' order by CreatTime desc");
                            PJ_24 qxfl = new PJ_24();
                            if (li.Count > 0)
                            {
                                qxfl = MainHelper.PlatformSqlMap.GetOneByKey<PJ_24>(li[0].ModleRecordID);

                            }
                            else
                            {
                                string str = " where RecordID='" + currRecord.ID + "'"
                             + " and  FieldName='申请原因' order by id";
                                WF_TableFieldValue mrv = MainHelper.PlatformSqlMap.GetOne<WF_TableFieldValue>(str);
                                //qxfl = new PJ_24();
                                if (mrv != null)
                                {
                                    qxfl.nr = mrv.ControlValue;
                                }
                                str = " where RecordID='" + currRecord.ID + "'"
                              + " and  FieldName='供电所名称' order by id";
                                mrv = MainHelper.PlatformSqlMap.GetOne<WF_TableFieldValue>(str
                               );
                                //qxfl = new PJ_24();
                                if (mrv != null)
                                {
                                    mOrg org = MainHelper.PlatformSqlMap.GetOne<mOrg>(" where orgname='" + mrv.ControlValue + "'");
                                    if (org != null)
                                        qxfl.ParentID = org.OrgID;
                                }
                                qxfl.CreateDate = DateTime.Now;
                                qxfl.CreateMan = MainHelper.User.UserName;
                                if (qxfl.BigData == null || qxfl.BigData.Length == 0)
                                {
                                    qxfl.BigData = new byte[0];
                                }
                                MainHelper.PlatformSqlMap.Create<PJ_24>(qxfl);

                                WF_ModleRecordWorkTaskIns mrwt = new WF_ModleRecordWorkTaskIns();
                                mrwt.ModleRecordID = qxfl.ID;
                                mrwt.RecordID = currRecord.ID;
                                mrwt.WorkFlowId = dt.Rows[0]["WorkFlowId"].ToString();
                                mrwt.WorkFlowInsId = dt.Rows[0]["WorkFlowInsId"].ToString();
                                mrwt.WorkTaskId = dt.Rows[0]["WorkTaskId"].ToString();
                                mrwt.ModleTableName = qxfl.GetType().ToString();
                                mrwt.WorkTaskInsId = dt.Rows[0]["WorkTaskInsId"].ToString();
                                mrwt.CreatTime = DateTime.Now;
                                MainHelper.PlatformSqlMap.Create<WF_ModleRecordWorkTaskIns>(mrwt);
                                readObj = qxfl;
                            }

                            ((frm24WorkFlowEdit)obj).RowData = qxfl;

                        }
                        //年度技改工程计划
                        else if (obj is frmJGGCJHWorkFlowEdit)
                        {
                            IList<WF_ModleRecordWorkTaskIns> li = MainHelper.PlatformSqlMap.GetListByWhere<WF_ModleRecordWorkTaskIns>(" where RecordID='" + currRecord.ID + "'"
                             + " and  WorkFlowId='" + dt.Rows[0]["WorkFlowId"].ToString() + "'" + " and ModleTableName='Ebada.Scgl.Model.PJ_jggcjh'"
                               + " and  WorkFlowInsId='" + dt.Rows[0]["WorkFlowInsId"].ToString() + "' order by CreatTime desc");
                            PJ_jggcjh qxfl = new PJ_jggcjh();
                            if (li.Count > 0)
                            {
                                qxfl = MainHelper.PlatformSqlMap.GetOneByKey<PJ_jggcjh>(li[0].ModleRecordID);

                            }
                            else
                            {
                                qxfl = new PJ_jggcjh();
                                qxfl.OrgName = MainHelper.UserCompany;
                                string str = " where RecordID='" + currRecord.ID + "'"
                                + " and  FieldName='申请单位' order by id";
                                WF_TableFieldValue mrv = MainHelper.PlatformSqlMap.GetOne<WF_TableFieldValue>(str);
                                //qxfl = new PJ_24();
                                if (mrv != null)
                                {
                                    qxfl.OrgName = mrv.ControlValue;
                                }
                                str = " where RecordID='" + currRecord.ID + "'"
                                + " and  FieldName='申请改造项目' order by id";
                                mrv = MainHelper.PlatformSqlMap.GetOne<WF_TableFieldValue>(str);
                                //qxfl = new PJ_24();
                                if (mrv != null)
                                {
                                    qxfl.ProjectName = mrv.ControlValue;
                                }
                                str = " where RecordID='" + currRecord.ID + "'"
                                + " and  FieldName='主要工程量' order by id";
                                mrv = MainHelper.PlatformSqlMap.GetOne<WF_TableFieldValue>(str);
                                //qxfl = new PJ_24();
                                if (mrv != null)
                                {
                                    qxfl.ProjecNR = mrv.ControlValue;
                                }
                                readObj = qxfl;
                            }

                            ((frmJGGCJHWorkFlowEdit)obj).RowData = qxfl;

                        }
                        //26电力线路防护通知书
                        else if (obj is frm26WorkFlowEdit)
                        {
                            IList<WF_ModleRecordWorkTaskIns> li = MainHelper.PlatformSqlMap.GetListByWhere<WF_ModleRecordWorkTaskIns>(" where RecordID='" + currRecord.ID + "'"
                             + " and  WorkFlowId='" + dt.Rows[0]["WorkFlowId"].ToString() + "'" + " and ModleTableName='Ebada.Scgl.Model.PJ_26'"
                               + " and  WorkFlowInsId='" + dt.Rows[0]["WorkFlowInsId"].ToString() + "' order by CreatTime desc");
                            PJ_26 qxfl = new PJ_26();
                            if (li.Count > 0)
                            {
                                qxfl = MainHelper.PlatformSqlMap.GetOneByKey<PJ_26>(li[0].ModleRecordID);

                            }
                            else
                            {
                                qxfl = new PJ_26();

                                readObj = qxfl;
                            }

                            ((frm26WorkFlowEdit)obj).RowData = qxfl;

                        }
                        if (readObj != null)
                            frmLP.ReadTaskData(readObj, dt, lp, currRecord);
                        if (((Form)obj).ShowDialog() == DialogResult.OK)
                        {
                            if (obj is WorkFlowLineSelectForm)
                            {

                                workFlowFormShow(currRecord, ((WorkFlowLineSelectForm)obj).RetWorkFlowData);
                            }
                        }
                    }
                InitData(strKind);
            }
            //获得编辑按钮的状态
            this.btEditfrm.Caption = currRecord.Status;
        }
Ejemplo n.º 9
0
        private void contextmenu_Click(object sender, EventArgs e)
        {

            int ihand = gridView1.FocusedRowHandle;
            if (ihand < 0)
                return;
            WF_WorkTaskInstance wti = (sender as MenuItem).Tag as WF_WorkTaskInstance;
            string taskid = wti.WorkTaskId;
            string workflowid = wti.WorkFlowId;
            string workflowinsid = wti.WorkFlowInsId;
            string pwfid = null;
            DataRow dr = gridView1.GetDataRow(ihand);
            LP_Record currRecord = new LP_Record();
            currRecord = MainHelper.PlatformSqlMap.GetOneByKey<LP_Record>(dr["ID"].ToString());
            string strwhere = string.Format(" where recordid='{0}'", currRecord.ID);
            IList<WFP_RecordWorkTaskIns> wf = MainHelper.PlatformSqlMap.GetList<WFP_RecordWorkTaskIns>("SelectWFP_RecordWorkTaskInsList", strwhere);
            //if (wf.Count == 0) {

            //    return;
            //} else {
            //    workflowinsid = wf[0].WorkFlowInsId;
            //}

            if (currRecord.ImageAttachment == null) currRecord.ImageAttachment = new byte[0];
            if (currRecord.SignImg == null) currRecord.SignImg = new byte[0];
            if (currRecord.DocContent == null) currRecord.DocContent = new byte[0];
            //DataTable dtall = RecordWorkTask.GetRecordWorkFlowData(currRecord.ID, MainHelper.User.UserID);
            DataTable dtall = new DataTable();// RecordWorkTask.GetRecordWorkFlowData(currRecord.ID, MainHelper.User.UserID);
            DataTable dt = new DataTable();


            DataTable dtret = null;

            dtret = RecordWorkTask.SelectedWorkflowTask(MainHelper.User.UserID, workflowid, workflowinsid, taskid, 1);
            if (dtret.Rows.Count == 0)
            {

                pwfid = wf[0].WorkFlowInsId;
                //while (dtret.Rows.Count == 0) 
                {
                    strwhere = string.Format(" where workflowid='{0}' and mainWorkFlowInsId='{1}'", workflowid, pwfid);
                    WF_WorkFlowInstance wfi = MainHelper.PlatformSqlMap.GetOne<WF_WorkFlowInstance>(strwhere);
                    if (wfi == null)
                    {
                        return;
                    }
                    workflowinsid = wfi.WorkFlowInsId;
                    workflowid = wfi.WorkFlowId;
                    dtret = RecordWorkTask.SelectedWorkflowTask(MainHelper.User.UserID, workflowid, workflowinsid, taskid, 1);

                }

            }
            if (dtret == null || dtret.Rows.Count == 0)
            {
                if (dtall.Rows.Count < 1)
                {
                    //if (currRecord.Status == "存档") {
                    //    //frmTemplate fm0 = new frmTemplate();
                    //    //fm0.ParentTemple = RecordWorkTask.GetWorkTaskTemple(dt, currRecord);
                    //    //fm0.CurrRecord = currRecord;
                    //    //fm0.Kind = strKind;
                    //    //fm0.Status = "edit";
                    //    //fm0.ShowDialog();
                    //    MsgBox.ShowAskMessageBox("已结束的流程不能在此处查阅。");
                    //} else
                    {
                        if (wf.Count > 0)
                        {
                            //WF_WorkFlowInstance wfi = MainHelper.PlatformSqlMap.GetOneByKey<WF_WorkFlowInstance>(wf[0].WorkFlowInsId);

                            //string struser = RecordWorkTask.GetWorkFlowTaskOperator(wf[0].WorkTaskInsId);
                            MsgBox.ShowTipMessageBox("没有操作此记录的权限,或者此节点没有相关文档 !");
                        }
                    }
                    return;
                }
                if (dtall.Rows.Count == 1 || currRecord.Status.IndexOf("|") == -1)
                {
                    dt = dtall;
                }
                else
                {
                    WorkFlowTaskSelectForm wfts = new WorkFlowTaskSelectForm();
                    wfts.RecordWorkFlowData = dtall;
                    if (wfts.ShowDialog() == DialogResult.OK)
                    {
                        dt = wfts.RetWorkFlowData;
                    }
                    else
                    {
                        return;
                    }
                }
            }
            else
            {
                dt = dtret;
            }
            //if (!RecordWorkTask.HaveRunRecordRole(currRecord.ID, MainHelper.User.UserID)) return;
            object obj = RecordWorkTask.GetWorkTaskModle(dt);
            if (obj == null)
            {
                return;
            }
            if (obj is frmLP)
            {
                frmViewTemplate fm = new frmViewTemplate();

                //DataTable dt = RecordWorkTask.GetRecordWorkFlowData(currRecord.ID, MainHelper.User.UserID);
                fm.ParentTemple = RecordWorkTask.GetWorkTaskTemple(dt, currRecord);
                fm.CurrRecord = currRecord;
                fm.Kind = strKind;
                fm.Status = "edit";
                fm.RecordWorkFlowData = dt;
                fm.ShowDialog();
            }
            else
            {
                if (obj.GetType().GetProperty("IsWorkflowCall") != null)
                    obj.GetType().GetProperty("IsWorkflowCall").SetValue(obj, true, null);
                else
                {
                    MsgBox.ShowWarningMessageBox("模块不支持IsWorkflowCall,请咨询开发人员!");
                    return;
                }
                if (obj.GetType().GetProperty("CurrRecord") != null)
                    obj.GetType().GetProperty("CurrRecord").SetValue(obj, currRecord, null);
                else
                {
                    MsgBox.ShowWarningMessageBox("模块不支持CurrRecord,请咨询开发人员!");
                    return;
                }

                if (obj.GetType().GetProperty("ReadOnly") != null)
                    obj.GetType().GetProperty("ReadOnly").SetValue(obj, true, null);
                else
                {
                    MsgBox.ShowWarningMessageBox("模块不支持ReadOnly只读属性,所以无法查看!");
                    return;
                }

                if (obj.GetType().GetProperty("ParentTemple") != null)
                    obj.GetType().GetProperty("ParentTemple").SetValue(obj, RecordWorkTask.GetWorkTaskTemple(dt, currRecord), null);
                else
                {
                    MsgBox.ShowWarningMessageBox("模块不支持ParentTemple,请咨询开发人员!");
                    return;
                }

                if (obj.GetType().GetProperty("RecordWorkFlowData") != null)
                    obj.GetType().GetProperty("RecordWorkFlowData").SetValue(obj, dt, null);
                else
                {
                    MsgBox.ShowWarningMessageBox("模块不支持RecordWorkFlowData,请咨询开发人员!");
                    return;
                }
                if (obj is UserControl)
                {

                    FormBase dlg = new FormBase();
                    dlg.Text = ((UserControl)obj).Name;
                    dlg.MdiParent = MainHelper.MainForm;
                    dlg.Controls.Add((UserControl)obj);
                    ((UserControl)obj).Dock = DockStyle.Fill;
                    dlg.Show();
                }
                else
                    if (obj is Form)
                    {
                        if (obj is frmyxfxWorkFlowEdit)
                        {
                            IList<WF_ModleRecordWorkTaskIns> li = MainHelper.PlatformSqlMap.GetListByWhere<WF_ModleRecordWorkTaskIns>(" where RecordID='" + currRecord.ID + "'"
                             + " and  WorkFlowId='" + dt.Rows[0]["WorkFlowId"].ToString() + "' and ModleTableName='Ebada.Scgl.Model.PJ_03yxfx'"
                               + " and  WorkFlowInsId='" + dt.Rows[0]["WorkFlowInsId"].ToString() + "' order by CreatTime desc");
                            PJ_03yxfx yxfx = new PJ_03yxfx();
                            if (li.Count > 0)
                            {
                                yxfx = MainHelper.PlatformSqlMap.GetOneByKey<PJ_03yxfx>(li[0].ModleRecordID);

                            }
                            else
                            {
                                yxfx = new PJ_03yxfx();
                                yxfx.OrgCode = MainHelper.UserOrg.OrgCode;
                                yxfx.OrgName = MainHelper.UserOrg.OrgName;
                                if (parentObj.FlowCaption.IndexOf("定期分析") > 0)
                                    yxfx.type = "定期分析";
                                else
                                    if (parentObj.FlowCaption.IndexOf("专题分析") > 0)
                                        yxfx.type = "专题分析";
                                ((frmyxfxWorkFlowEdit)obj).RecordStatus = 0;
                                yxfx.rq = DateTime.Now;
                                ((frmyxfxWorkFlowEdit)obj).RowData = yxfx;
                            }
                            switch (dt.Rows[0]["TaskInsCaption"].ToString())
                            {
                                case "填写":
                                    ((frmyxfxWorkFlowEdit)obj).RecordStatus = 0;
                                    break;
                                case "领导检查":
                                    ((frmyxfxWorkFlowEdit)obj).RecordStatus = 1;
                                    break;
                                case "检查人检查":
                                    ((frmyxfxWorkFlowEdit)obj).RecordStatus = 2;
                                    break;

                            }
                            yxfx.rq = DateTime.Now;
                            ((frmyxfxWorkFlowEdit)obj).RowData = yxfx;

                        }
                        else if (obj is frmsbqxWorkFlowEdit)
                        {
                            IList<WF_ModleRecordWorkTaskIns> li = MainHelper.PlatformSqlMap.GetListByWhere<WF_ModleRecordWorkTaskIns>(" where RecordID='" + currRecord.ID + "'"
                             + " and  WorkFlowId='" + dt.Rows[0]["WorkFlowId"].ToString() + "'" + " and ModleTableName='Ebada.Scgl.Model.PJ_qxfl'"
                               + " and  WorkFlowInsId='" + dt.Rows[0]["WorkFlowInsId"].ToString() + "' order by CreatTime desc");
                            PJ_qxfl qxfl = new PJ_qxfl();
                            if (li.Count > 0)
                            {
                                qxfl = MainHelper.PlatformSqlMap.GetOneByKey<PJ_qxfl>(li[0].ModleRecordID);

                            }
                            else
                            {
                                qxfl = new PJ_qxfl();
                                qxfl.OrgCode = MainHelper.UserOrg.OrgCode;
                                qxfl.OrgName = MainHelper.UserOrg.OrgName;
                                qxfl.xssj = DateTime.Today;
                            }

                            ((frmsbqxWorkFlowEdit)obj).RowData = qxfl;

                        }
                        else if (obj is frmWorkFlow06sbxsEdit)
                        {
                            IList<WF_ModleRecordWorkTaskIns> li = MainHelper.PlatformSqlMap.GetListByWhere<WF_ModleRecordWorkTaskIns>(" where RecordID='" + currRecord.ID + "'"
                              + "  and (ModleTableName='Ebada.Scgl.Model.PJ_qxfl' or ModleTableName='Ebada.Scgl.Model.PJ_06sbxsmx' )"
                                + "  order by CreatTime desc");
                            PJ_06sbxsmx qxfl = new PJ_06sbxsmx();
                            if (li.Count > 0)
                            {
                                qxfl = MainHelper.PlatformSqlMap.GetOneByKey<PJ_06sbxsmx>(li[0].ModleRecordID);


                                PJ_qxfl qxfltemp = MainHelper.PlatformSqlMap.GetOne<PJ_qxfl>(" where CreateDate =  '" + qxfl.CreateDate + "'"
                                    + " and LineID='" + qxfl.LineID + "'"
                                    + " and OrgCode='" + qxfl.OrgCode + "'"
                                     + " and qxlb='" + qxfl.qxlb + "'"
                                     + " and xsr='" + qxfl.xsr + "'"
                                     + " and xlqd='" + qxfl.xlqd + "'"
                                    );
                                if (qxfl == null)
                                {
                                    qxfl = new PJ_06sbxsmx();
                                    qxfl.CreateDate = qxfltemp.CreateDate;
                                    qxfl.LineID = qxfltemp.LineID;
                                    qxfl.LineName = qxfltemp.LineName;
                                    qxfl.OrgCode = qxfltemp.OrgCode;
                                    qxfl.OrgName = qxfltemp.OrgName;
                                    qxfl.qxlb = qxfltemp.qxlb;
                                    qxfl.qxnr = qxfltemp.qxnr;
                                    qxfl.xssj = qxfltemp.xssj;
                                    qxfl.xsr = qxfltemp.xsr;
                                    qxfl.xcqx = qxfltemp.xcqx;
                                    qxfl.xlqd = qxfltemp.xlqd;
                                    qxfl.CreateDate = DateTime.Now;
                                    qxfl.CreateMan = MainHelper.User.UserName;
                                    //MainHelper.PlatformSqlMap.Create<PJ_06sbxs>(qxfl);

                                    //WF_ModleRecordWorkTaskIns mrwt = new WF_ModleRecordWorkTaskIns();
                                    //mrwt.ModleRecordID = qxfl.ID;
                                    //mrwt.RecordID = lpr.ID;
                                    //mrwt.WorkFlowId = recordWorkFlowData.Rows[0]["WorkFlowId"].ToString();
                                    //mrwt.WorkFlowInsId = recordWorkFlowData.Rows[0]["WorkFlowInsId"].ToString();
                                    //mrwt.WorkTaskId = recordWorkFlowData.Rows[0]["WorkTaskId"].ToString();
                                    //mrwt.ModleTableName = qxfl.GetType().ToString();
                                    //mrwt.WorkTaskInsId = recordWorkFlowData.Rows[0]["WorkTaskInsId"].ToString();
                                    //mrwt.CreatTime = DateTime.Now;
                                    //MainHelper.PlatformSqlMap.Create<WF_ModleRecordWorkTaskIns>(mrwt);
                                }
                            }
                            else
                            {
                                qxfl = new PJ_06sbxsmx();
                                qxfl.OrgCode = MainHelper.UserOrg.OrgCode;
                                qxfl.OrgName = MainHelper.UserOrg.OrgName;
                                qxfl.CreateDate = DateTime.Now;
                                qxfl.CreateMan = MainHelper.User.UserName;
                                //MainHelper.PlatformSqlMap.Create<PJ_06sbxs>(qxfl);

                                //WF_ModleRecordWorkTaskIns mrwt = new WF_ModleRecordWorkTaskIns();
                                //mrwt.ModleRecordID = qxfl.ID;
                                //mrwt.RecordID = lpr.ID;
                                //mrwt.WorkFlowId = recordWorkFlowData.Rows[0]["WorkFlowId"].ToString();
                                //mrwt.WorkFlowInsId = recordWorkFlowData.Rows[0]["WorkFlowInsId"].ToString();
                                //mrwt.WorkTaskId = recordWorkFlowData.Rows[0]["WorkTaskId"].ToString();
                                //mrwt.ModleTableName = qxfl.GetType().ToString();
                                //mrwt.WorkTaskInsId = recordWorkFlowData.Rows[0]["WorkTaskInsId"].ToString();
                                //mrwt.CreatTime = DateTime.Now;
                                //MainHelper.PlatformSqlMap.Create<WF_ModleRecordWorkTaskIns>(mrwt);

                            }


                            ((frmWorkFlow06sbxsEdit)obj).RowData = qxfl;

                        }
                        else if (obj is frm08SBTDJXWorkFlowEdit)
                        {
                            IList<WF_ModleRecordWorkTaskIns> li = MainHelper.PlatformSqlMap.GetListByWhere<WF_ModleRecordWorkTaskIns>(" where RecordID='" + currRecord.ID + "'"
                               + " and  WorkFlowId='" + dt.Rows[0]["WorkFlowId"].ToString() + "' and ModleTableName='Ebada.Scgl.Model.PJ_08sbtdjx'"
                                 + " and  WorkFlowInsId='" + dt.Rows[0]["WorkFlowInsId"].ToString() + "' order by CreatTime desc");
                            PJ_08sbtdjx qxfl = new PJ_08sbtdjx();
                            if (li.Count > 0)
                            {

                                qxfl = MainHelper.PlatformSqlMap.GetOneByKey<PJ_08sbtdjx>(li[0].ModleRecordID);
                                if (qxfl == null) qxfl = new PJ_08sbtdjx();

                            }
                            else
                            {
                                qxfl = new PJ_08sbtdjx();
                                qxfl.OrgCode = MainHelper.UserOrg.OrgCode;
                                qxfl.OrgName = MainHelper.UserOrg.OrgName;
                                qxfl.CreateDate = DateTime.Now;
                                string str = " where RecordID='" + currRecord.ID + "'"
                             + " and  FieldName='类别' order by id";
                                WF_TableFieldValue mrv = MainHelper.PlatformSqlMap.GetOne<WF_TableFieldValue>(str
                                 );
                                //qxfl = new PJ_24();
                                if (mrv != null)
                                {
                                    qxfl.tdxz = mrv.ControlValue;
                                }


                            }

                            ((frm08SBTDJXWorkFlowEdit)obj).RowData = qxfl;

                        }
                        else if (obj is frmsgzaycWorkFlowEdit)
                        {
                            IList<WF_ModleRecordWorkTaskIns> li = MainHelper.PlatformSqlMap.GetListByWhere<WF_ModleRecordWorkTaskIns>(" where RecordID='" + currRecord.ID + "'"
                             + "  and ModleTableName='Ebada.Scgl.Model.PJ_04sgzayc'"
                               + "  order by CreatTime desc");
                            PJ_04sgzayc qxfl = new PJ_04sgzayc();
                            if (li.Count > 0)
                            {
                                qxfl = MainHelper.PlatformSqlMap.GetOneByKey<PJ_04sgzayc>(li[0].ModleRecordID);
                                if (qxfl == null) qxfl = new PJ_04sgzayc();

                            }
                            else
                            {
                                qxfl = new PJ_04sgzayc();
                                qxfl.OrgCode = MainHelper.UserOrg.OrgCode;
                                qxfl.OrgName = MainHelper.UserOrg.OrgName;

                            }

                            ((frmsgzaycWorkFlowEdit)obj).RowData = qxfl;

                        }
                        else if (obj is frmTDJHWorkFlowEdit)
                        {
                            IList<WF_ModleRecordWorkTaskIns> li = MainHelper.PlatformSqlMap.GetListByWhere<WF_ModleRecordWorkTaskIns>(" where RecordID='" + currRecord.ID + "'"
                             + " and  WorkFlowId='" + dt.Rows[0]["WorkFlowId"].ToString() + "' and ModleTableName='Ebada.Scgl.Model.PJ_tdjh'"
                               + " and  WorkFlowInsId='" + dt.Rows[0]["WorkFlowInsId"].ToString() + "' order by CreatTime desc");
                            PJ_tdjh qxfl = new PJ_tdjh();
                            if (li.Count > 0)
                            {
                                qxfl = MainHelper.PlatformSqlMap.GetOneByKey<PJ_tdjh>(li[0].ModleRecordID);

                            }
                            else
                            {
                                li = MainHelper.PlatformSqlMap.GetListByWhere<WF_ModleRecordWorkTaskIns>(" where RecordID='" + currRecord.ID + "'"
                             + " and  WorkFlowId='" + dt.Rows[0]["WorkFlowId"].ToString() + "' and ModleTableName='Ebada.Scgl.Model.PJ_qxfl'"
                               + " and  WorkFlowInsId='" + dt.Rows[0]["WorkFlowInsId"].ToString() + "' order by CreatTime desc");
                                qxfl = new PJ_tdjh();
                                if (li.Count > 0)
                                {
                                    PJ_qxfl qxfltemp = MainHelper.PlatformSqlMap.GetOneByKey<PJ_qxfl>(li[0].ModleRecordID);
                                    qxfl.OrgCode = qxfltemp.OrgCode;
                                    qxfl.SQOrgname = qxfltemp.OrgName;
                                    qxfl.OrgName = qxfltemp.OrgName;
                                    qxfl.JXNR = qxfltemp.qxnr;
                                    qxfl.S1 = "缺陷管理流程";
                                }
                                else
                                {
                                    qxfl.OrgCode = MainHelper.UserOrg.OrgCode;
                                    qxfl.OrgName = MainHelper.UserOrg.OrgName;
                                }

                            }

                            ((frmTDJHWorkFlowEdit)obj).RowData = qxfl;

                        }
                        else if (obj is frm24WorkFlowEdit)
                        {
                            IList<WF_ModleRecordWorkTaskIns> li = MainHelper.PlatformSqlMap.GetListByWhere<WF_ModleRecordWorkTaskIns>(" where RecordID='" + currRecord.ID + "'"
                             + " and  WorkFlowId='" + dt.Rows[0]["WorkFlowId"].ToString() + "' and ModleTableName='Ebada.Scgl.Model.PJ_24'"
                               + " and  WorkFlowInsId='" + dt.Rows[0]["WorkFlowInsId"].ToString() + "' order by CreatTime desc");
                            PJ_24 qxfl = new PJ_24();
                            if (li.Count > 0)
                            {
                                qxfl = MainHelper.PlatformSqlMap.GetOneByKey<PJ_24>(li[0].ModleRecordID);

                            }
                            else
                            {
                                string str = " where RecordID='" + currRecord.ID + "'"
                             + " and  FieldName='申请原因' order by id";
                                WF_TableFieldValue mrv = MainHelper.PlatformSqlMap.GetOne<WF_TableFieldValue>(str);
                                //qxfl = new PJ_24();
                                if (mrv != null)
                                {
                                    qxfl.nr = mrv.ControlValue;
                                }
                                str = " where RecordID='" + currRecord.ID + "'"
                              + " and  FieldName='供电所名称' order by id";
                                mrv = MainHelper.PlatformSqlMap.GetOne<WF_TableFieldValue>(str
                               );
                                //qxfl = new PJ_24();
                                if (mrv != null)
                                {
                                    mOrg org = MainHelper.PlatformSqlMap.GetOne<mOrg>(" where orgname='" + mrv.ControlValue + "'");
                                    if (org != null)
                                        qxfl.ParentID = org.OrgID;
                                }
                                qxfl.CreateDate = DateTime.Now;
                                qxfl.CreateMan = MainHelper.User.UserName;
                                if (qxfl.BigData == null || qxfl.BigData.Length == 0)
                                {
                                    qxfl.BigData = new byte[0];
                                }

                            }

                            ((frm24WorkFlowEdit)obj).RowData = qxfl;

                        }
                        //年度技改工程计划
                        else if (obj is frmJGGCJHWorkFlowEdit)
                        {
                            IList<WF_ModleRecordWorkTaskIns> li = MainHelper.PlatformSqlMap.GetListByWhere<WF_ModleRecordWorkTaskIns>(" where RecordID='" + currRecord.ID + "'"
                             + " and  WorkFlowId='" + dt.Rows[0]["WorkFlowId"].ToString() + "'" + " and ModleTableName='Ebada.Scgl.Model.PJ_jggcjh'"
                               + " and  WorkFlowInsId='" + dt.Rows[0]["WorkFlowInsId"].ToString() + "' order by CreatTime desc");
                            PJ_jggcjh qxfl = new PJ_jggcjh();
                            if (li.Count > 0)
                            {
                                qxfl = MainHelper.PlatformSqlMap.GetOneByKey<PJ_jggcjh>(li[0].ModleRecordID);

                            }
                            else
                            {
                                qxfl = new PJ_jggcjh();
                                qxfl.OrgName = MainHelper.UserCompany;
                                string str = " where RecordID='" + currRecord.ID + "'"
                                + " and  FieldName='申请单位' order by id";
                                WF_TableFieldValue mrv = MainHelper.PlatformSqlMap.GetOne<WF_TableFieldValue>(str);
                                //qxfl = new PJ_24();
                                if (mrv != null)
                                {
                                    qxfl.OrgName = mrv.ControlValue;
                                }
                                str = " where RecordID='" + currRecord.ID + "'"
                                + " and  FieldName='申请改造项目' order by id";
                                mrv = MainHelper.PlatformSqlMap.GetOne<WF_TableFieldValue>(str);
                                //qxfl = new PJ_24();
                                if (mrv != null)
                                {
                                    qxfl.ProjectName = mrv.ControlValue;
                                }
                                str = " where RecordID='" + currRecord.ID + "'"
                                + " and  FieldName='主要工程量' order by id";
                                mrv = MainHelper.PlatformSqlMap.GetOne<WF_TableFieldValue>(str);
                                //qxfl = new PJ_24();
                                if (mrv != null)
                                {
                                    qxfl.ProjecNR = mrv.ControlValue;
                                }

                            }

                            ((frmJGGCJHWorkFlowEdit)obj).RowData = qxfl;

                        }
                        //26电力线路防护通知书
                        else if (obj is frm26WorkFlowEdit)
                        {
                            IList<WF_ModleRecordWorkTaskIns> li = MainHelper.PlatformSqlMap.GetListByWhere<WF_ModleRecordWorkTaskIns>(" where RecordID='" + currRecord.ID + "'"
                             + " and  WorkFlowId='" + dt.Rows[0]["WorkFlowId"].ToString() + "'" + " and ModleTableName='Ebada.Scgl.Model.PJ_26'"
                               + " and  WorkFlowInsId='" + dt.Rows[0]["WorkFlowInsId"].ToString() + "' order by CreatTime desc");
                            PJ_26 qxfl = new PJ_26();
                            if (li.Count > 0)
                            {
                                qxfl = MainHelper.PlatformSqlMap.GetOneByKey<PJ_26>(li[0].ModleRecordID);

                            }
                            else
                            {
                                qxfl = new PJ_26();


                            }

                            ((frm26WorkFlowEdit)obj).RowData = qxfl;

                        }
                        if (((Form)obj).ShowDialog() == DialogResult.OK)
                        {
                            if (obj is WorkFlowLineSelectForm)
                            {

                                workFlowFormShow(currRecord, ((WorkFlowLineSelectForm)obj).RetWorkFlowData);
                            }
                        }
                    }
            }
            //Bitmap objBitmap = RecordWorkTask.WorkFlowBitmap(dr["ID"].ToString(), new Size(1024, 768));
            //string tempPath = Path.GetTempPath();
            //string tempfile = tempPath + "~" + Guid.NewGuid().ToString() + ".png";
            //if (objBitmap != null)
            //{


            //    objBitmap.Save(tempfile, System.Drawing.Imaging.ImageFormat.Png);
            //    try
            //    {
            //        //System.Diagnostics.Process.Start("explorer.exe", tempfile);
            //        SelectorHelper.Execute("rundll32.exe %Systemroot%\\System32\\shimgvw.dll,ImageView_Fullscreen " + tempfile);
            //    }
            //    catch
            //    {


            //    }
            //}
        }
Ejemplo n.º 10
0
        private void barxqjh_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            //请求确认
            if (MsgBox.ShowAskMessageBox("是否确认此节点结束,生成消缺计划并进入下一流程?") != DialogResult.OK)
            {
                //SendMessage(this.Handle, 0x0010, (IntPtr)0, (IntPtr)0);
                return;
            }
            string slqwhere = "where OrgCode='" + parentID + "' ";
            slqwhere = slqwhere + " and id not in (select ModleRecordID from WF_ModleRecordWorkTaskIns where RecordID='" + CurrRecord.ID + "'";
            slqwhere = slqwhere + " and  WorkFlowId='" + WorkFlowData.Rows[0]["WorkFlowId"].ToString() + "'"
                   + " and  WorkFlowInsId='" + WorkFlowData.Rows[0]["WorkFlowInsId"].ToString() + "'"
                   + " and  WorkTaskId='" + WorkFlowData.Rows[0]["WorkTaskId"].ToString() + "'"
                   + " and  WorkTaskInsId='" + WorkFlowData.Rows[0]["WorkTaskInsId"].ToString() + "')"
             + " and DATEDIFF(day,cast('1900-1-1'  as datetime ) ,cast(xcrq  as datetime) )<1 ";
            slqwhere += " order by id desc";
            dalist = MainHelper.PlatformSqlMap.GetListByWhere<PJ_06sbxs>(slqwhere);
            string strmes = "";

            if (RecordWorkTask.CheckOnRiZhi(WorkFlowData))
            {

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

            }

            WF_WorkTaskCommands 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);
            if (fjly == null) fjly = new frmModleFjly();
            fjly.btn_Submit_Click(sender, e);
            strmes = RecordWorkTask.GetWorkFlowTaskCaption(WorkFlowData.Rows[0]["WorkTaskInsId"].ToString());
            if (strmes == "结束节点1")
            {
                currRecord.Status = "存档";
            }
            else
            {
                currRecord.Status = strmes;
            }
            currRecord.LastChangeTime = DateTime.Now.ToString();
            if (currRecord.ImageAttachment == null) currRecord.ImageAttachment = new byte[0];
            if (currRecord.SignImg == null) currRecord.SignImg = new byte[0];
            MainHelper.PlatformSqlMap.Update("UpdateLP_Record", CurrRecord);

            DataTable dt = RecordWorkTask.GetRecordWorkFlowData(currRecord.ID, MainHelper.User.UserID);
            slqwhere = "where OrgCode='" + parentID + "' ";
            slqwhere = slqwhere + " and (id not in (select ModleRecordID from WF_ModleRecordWorkTaskIns where 1=1 ";
            slqwhere = slqwhere + " and  WorkFlowId='" + WorkFlowData.Rows[0]["WorkFlowId"].ToString() + "'"

               + " and  WorkTaskId='" + WorkFlowData.Rows[0]["WorkTaskId"].ToString() + "') "
               + " or (id  in (select ModleRecordID from WF_ModleRecordWorkTaskIns where 1=1 ";
            slqwhere = slqwhere + " and  RecordID='" + currRecord.ID + "'"
              + " and  WorkFlowInsId='" + WorkFlowData.Rows[0]["WorkFlowInsId"].ToString() + "' "
              + " and  WorkTaskInsId='" + WorkFlowData.Rows[0]["WorkTaskInsId"].ToString() + "' "
               + " and  WorkTaskId='" + WorkFlowData.Rows[0]["WorkTaskId"].ToString() + "')) "
              + ")"
              ;

            slqwhere += " order by id desc";
            dalist = MainHelper.PlatformSqlMap.GetListByWhere<PJ_06sbxs>(slqwhere);
            foreach (PJ_06sbxs sbxs in dalist)
            {
                if (sbxs.qxlb == "") continue;
                WF_ModleRecordWorkTaskIns mrwt = new WF_ModleRecordWorkTaskIns();
                PJ_qxfl qxfj = new PJ_qxfl();
                if (WorkFlowData.Rows[0]["flowcaption"].ToString() == "春查消缺外查")
                {
                    PJ_ccxqjh ccxqjh = new PJ_ccxqjh();
                    ccxqjh.ID = sbxs.ID;
                    ccxqjh.OrgCode = sbxs.OrgCode;
                    ccxqjh.OrgName = sbxs.OrgName;
                    ccxqjh.qxlb = sbxs.qxlb;
                    ccxqjh.xqlr = sbxs.qxnr;
                    Thread.Sleep(new TimeSpan(100000));//0.1毫秒
                    try
                    {
                        MainHelper.PlatformSqlMap.Create<PJ_ccxqjh>(ccxqjh);
                    }
                    catch { }
                    qxfj.ID = ccxqjh.ID;

                    mrwt.ID = mrwt.CreateID();
                    mrwt.ModleRecordID = ccxqjh.ID;
                    mrwt.RecordID = currRecord.ID;
                    mrwt.WorkFlowId = dt.Rows[0]["WorkFlowId"].ToString();
                    mrwt.WorkFlowInsId = dt.Rows[0]["WorkFlowInsId"].ToString();
                    mrwt.WorkTaskId = dt.Rows[0]["WorkTaskId"].ToString();
                    mrwt.ModleTableName = ccxqjh.GetType().ToString();
                    mrwt.WorkTaskInsId = dt.Rows[0]["WorkTaskInsId"].ToString();
                    mrwt.CreatTime = DateTime.Now;
                    Thread.Sleep(new TimeSpan(100000));//0.1毫秒

                }
                else
                    if (WorkFlowData.Rows[0]["flowcaption"].ToString() == "秋查消缺外查")
                    {

                        PJ_qcxqjh qcxqjh = new PJ_qcxqjh();
                        qcxqjh.ID = sbxs.ID;
                        qcxqjh.OrgCode = sbxs.OrgCode;
                        qcxqjh.OrgName = sbxs.OrgName;
                        qcxqjh.qxlb = sbxs.qxlb;
                        qcxqjh.xqlr = sbxs.qxnr;
                        Thread.Sleep(new TimeSpan(100000));//0.1毫秒
                        try
                        {
                            MainHelper.PlatformSqlMap.Create<PJ_qcxqjh>(qcxqjh);
                        }
                        catch { }
                        qxfj.ID = qcxqjh.ID;


                        mrwt.ID = mrwt.CreateID();
                        mrwt.ModleRecordID = qcxqjh.ID;
                        mrwt.RecordID = currRecord.ID;
                        mrwt.WorkFlowId = dt.Rows[0]["WorkFlowId"].ToString();
                        mrwt.WorkFlowInsId = dt.Rows[0]["WorkFlowInsId"].ToString();
                        mrwt.WorkTaskId = dt.Rows[0]["WorkTaskId"].ToString();
                        mrwt.ModleTableName = qcxqjh.GetType().ToString();
                        mrwt.WorkTaskInsId = dt.Rows[0]["WorkTaskInsId"].ToString();
                        mrwt.CreatTime = DateTime.Now;
                        Thread.Sleep(new TimeSpan(100000));//0.1毫秒
                    }

                qxfj.CreateDate = sbxs.CreateDate;
                qxfj.CreateMan = sbxs.CreateMan;
                qxfj.LineID = sbxs.LineID;
                qxfj.LineName = sbxs.LineName;
                qxfj.OrgCode = sbxs.OrgCode;
                qxfj.OrgName = sbxs.OrgName;
                qxfj.qxlb = sbxs.qxlb;
                qxfj.qxly = "设备巡视";
                qxfj.qxnr = sbxs.qxnr;
                qxfj.xcqx = sbxs.xcqx;
                qxfj.xcr = sbxs.xcr;
                qxfj.xlqd = sbxs.xlqd;
                qxfj.xsr = sbxs.xsr;
                qxfj.xssj = sbxs.xssj;
                try
                {
                    MainHelper.PlatformSqlMap.Create<PJ_qxfl>(qxfj);
                }
                catch { }



                MainHelper.PlatformSqlMap.Create<WF_ModleRecordWorkTaskIns>(mrwt);
                //Thread.Sleep(new TimeSpan(100000));//0.1毫秒
                //mrwt = new WF_ModleRecordWorkTaskIns();
                //mrwt.ID = mrwt.CreateID();
                //mrwt.ModleRecordID = qxfj.ID;
                //mrwt.RecordID = currRecord.ID;
                //mrwt.WorkFlowId = dt.Rows[0]["WorkFlowId"].ToString();
                //mrwt.WorkFlowInsId = dt.Rows[0]["WorkFlowInsId"].ToString();
                //mrwt.WorkTaskId = dt.Rows[0]["WorkTaskId"].ToString();
                //mrwt.ModleTableName = qxfj.GetType().ToString();
                //mrwt.WorkTaskInsId = dt.Rows[0]["WorkTaskInsId"].ToString();
                //mrwt.CreatTime = DateTime.Now;
                //Thread.Sleep(new TimeSpan(100000));//0.1毫秒
                //MainHelper.PlatformSqlMap.Create<WF_ModleRecordWorkTaskIns>(mrwt);

                mrwt = new WF_ModleRecordWorkTaskIns();
                mrwt.ID = mrwt.CreateID();
                mrwt.ModleRecordID = sbxs.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 = sbxs.GetType().ToString();
                mrwt.WorkTaskInsId = WorkFlowData.Rows[0]["WorkTaskInsId"].ToString();
                mrwt.CreatTime = DateTime.Now;
                Thread.Sleep(new TimeSpan(100000));//0.1毫秒
                MainHelper.PlatformSqlMap.Create<WF_ModleRecordWorkTaskIns>(mrwt);
            }
            gridControl1.FindForm().Close();
        }
Ejemplo n.º 11
0
        private void btAddfrm_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (MainHelper.UserOrg == null) return;

            if (!RecordWorkTask.HaveRunNewGZPRole(strKind, MainHelper.User.UserID)) return;
            DataTable recordWorkFlowData = null;
            object obj = RecordWorkTask.GetNewWorkTaskModle(strKind, MainHelper.User.UserID);
            if (obj == null)
            {
                MsgBox.ShowWarningMessageBox("出错,未找到对应的模块,请检查模板设置!");
                return;
            }
            LP_Record lpr = new LP_Record();
            lpr.ID = "N" + lpr.CreateID();
            lpr.Kind = strKind;
            lpr.CreateTime = DateTime.Now.ToString();
            lpr.OrgName = MainHelper.UserOrg.OrgName;
            if (obj is frmLP)
            {
                frmLP frm = new frmLP();
                frm.strxiestatus = "add";
                frm.Status = "add";
                frm.Kind = strKind;
                string[] strtemp = RecordWorkTask.RunNewGZPRecord(lpr.ID, strKind, MainHelper.User.UserID, false);

                //frm.ParentTemple = RecordWorkTask.GetNewWorkTaskTemple(strKind, MainHelper.User.UserID);

                //frm.RecordWorkFlowData = RecordWorkTask.GetGZPRecordSartWorkData(ParentObj.FlowCaption, MainHelper.User.UserID);
                frm.RecordWorkFlowData = RecordWorkTask.GetRecordWorkFlowData(lpr.ID, MainHelper.User.UserID);
                recordWorkFlowData = frm.RecordWorkFlowData;
                if (frm.RecordWorkFlowData == null)
                {
                    MsgBox.ShowWarningMessageBox("出错,未找到该流程信息,请检查模板设置!");
                }
                frm.ParentTemple = RecordWorkTask.GetWorkTaskTemple(frm.RecordWorkFlowData, lpr);
                if (frm.ParentTemple == null)
                {
                    MsgBox.ShowWarningMessageBox("出错,未找到该节点关联的表单,请检查模板设置!");
                }
                lpr.Number = RecordWorkTask.CreatWorkFolwNo(MainHelper.UserOrg, frm.ParentTemple.LPID, lpr.Kind);
                lpr.Status = frm.RecordWorkFlowData.Rows[0]["TaskCaption"].ToString();
                //lpr.Status = "填票";
                //frm.RowData = lpr;
                frm.CurrRecord = lpr;
                MainHelper.PlatformSqlMap.Create<LP_Record>(lpr);
                frm.ShowDialog();
                InitData(strKind);
            }
            else
            {


                string[] strtemp = RecordWorkTask.RunNewGZPRecord(lpr.ID, strKind, MainHelper.User.UserID, false);
                if (strtemp[0].IndexOf("未提交至任何人") > -1)
                {
                    MsgBox.ShowTipMessageBox("未提交至任何人,创建失败,请检查流程模板和组织机构配置是否正确!");
                    return;
                }
                recordWorkFlowData = RecordWorkTask.GetRecordWorkFlowData(lpr.ID, MainHelper.User.UserID);
                if (recordWorkFlowData == null)
                {
                    MsgBox.ShowWarningMessageBox("出错,未找到该流程信息,请检查模板设置!");

                }
                LP_Temple ParentTemple = RecordWorkTask.GetWorkTaskTemple(recordWorkFlowData, lpr);
                if (ParentTemple == null)
                    lpr.Number = RecordWorkTask.CreatWorkFolwNo(MainHelper.UserOrg, "", strKind);
                else
                    lpr.Number = RecordWorkTask.CreatWorkFolwNo(MainHelper.UserOrg, ParentTemple.LPID, strKind);

                lpr.Status = recordWorkFlowData.Rows[0]["TaskCaption"].ToString();
                MainHelper.PlatformSqlMap.Create<LP_Record>(lpr);

                if (obj.GetType().GetProperty("IsWorkflowCall") != null)
                    obj.GetType().GetProperty("IsWorkflowCall").SetValue(obj, true, null);
                else
                {
                    MsgBox.ShowWarningMessageBox("模块不支持,请咨询开发人员!");
                    return;
                }
                if (obj.GetType().GetProperty("CurrRecord") != null)
                    obj.GetType().GetProperty("CurrRecord").SetValue(obj, lpr, null);
                else
                {
                    MsgBox.ShowWarningMessageBox("模块不支持,请咨询开发人员!");
                    return;
                }


                if (obj.GetType().GetProperty("ParentTemple") != null)
                    obj.GetType().GetProperty("ParentTemple").SetValue(obj, ParentTemple, null);
                else
                {
                    MsgBox.ShowWarningMessageBox("模块不支持,请咨询开发人员!");
                    return;
                }

                if (obj.GetType().GetProperty("RecordWorkFlowData") != null)
                    obj.GetType().GetProperty("RecordWorkFlowData").SetValue(obj, recordWorkFlowData, null);
                else
                {
                    MsgBox.ShowWarningMessageBox("模块不支持,请咨询开发人员!");
                    return;
                }

                if (obj is UserControl)
                {
                    FormBase dlg = new FormBase();
                    dlg.Text = ((UserControl)obj).Name;
                    dlg.MdiParent = MainHelper.MainForm;
                    dlg.Controls.Add((UserControl)obj);
                    ((UserControl)obj).Dock = DockStyle.Fill;
                    dlg.Show();
                }
                else
                    if (obj is Form)
                    {
                        if (obj is frmyxfxWorkFlowEdit)
                        {
                            PJ_03yxfx yxfx = new PJ_03yxfx();
                            yxfx.OrgCode = MainHelper.UserOrg.OrgCode;
                            yxfx.OrgName = MainHelper.UserOrg.OrgName;
                            if (parentObj.FlowCaption.IndexOf("定期分析") > 0)
                                yxfx.type = "定期分析";
                            else
                                if (parentObj.FlowCaption.IndexOf("专题分析") > 0)
                                    yxfx.type = "专题分析";
                            ((frmyxfxWorkFlowEdit)obj).RecordStatus = 0;
                            yxfx.rq = DateTime.Now;
                            ((frmyxfxWorkFlowEdit)obj).RowData = yxfx;

                        }
                        else if (obj is frmsbqxWorkFlowEdit)
                        {

                            PJ_qxfl qxfl = new PJ_qxfl();
                            qxfl = new PJ_qxfl();
                            qxfl.OrgCode = MainHelper.UserOrg.OrgCode;
                            qxfl.OrgName = MainHelper.UserOrg.OrgName;
                            ((frmsbqxWorkFlowEdit)obj).RowData = qxfl;

                        }
                        else if (obj is frmWorkFlow06sbxsEdit)
                        {
                            IList<WF_ModleRecordWorkTaskIns> li = MainHelper.PlatformSqlMap.GetListByWhere<WF_ModleRecordWorkTaskIns>(" where RecordID='" + lpr.ID + "'"
                             + " and  WorkFlowId='" + recordWorkFlowData.Rows[0]["WorkFlowId"].ToString() + "' and ModleTableName='Ebada.Scgl.Model.PJ_06sbxsmx'"
                               + " and  WorkFlowInsId='" + recordWorkFlowData.Rows[0]["WorkFlowInsId"].ToString() + "' order by CreatTime desc");
                            PJ_06sbxsmx qxfl = new PJ_06sbxsmx();
                            if (li.Count > 0)
                            {
                                PJ_qxfl qxfltemp = MainHelper.PlatformSqlMap.GetOneByKey<PJ_qxfl>(li[0].ModleRecordID);


                                qxfl = MainHelper.PlatformSqlMap.GetOne<PJ_06sbxsmx>(" where CONVERT(varchar, CreateDate, 120 ) =  '" + qxfltemp.CreateDate + "'"
                                    + " and LineID='" + qxfltemp.LineID + "'"
                                    + " and OrgCode='" + qxfltemp.OrgCode + "'"
                                     + " and qxlb='" + qxfltemp.qxlb + "'"
                                     + " and xsr='" + qxfltemp.xsr + "'"
                                     + " and xlqd='" + qxfltemp.xlqd + "'"
                                    );
                                if (qxfl == null)
                                {
                                    qxfl = new PJ_06sbxsmx();
                                    qxfl.CreateDate = qxfltemp.CreateDate;
                                    qxfl.LineID = qxfltemp.LineID;
                                    qxfl.LineName = qxfltemp.LineName;
                                    qxfl.OrgCode = qxfltemp.OrgCode;
                                    qxfl.OrgName = qxfltemp.OrgName;
                                    qxfl.qxlb = qxfltemp.qxlb;
                                    qxfl.qxnr = qxfltemp.qxnr;
                                    qxfl.xssj = qxfltemp.xssj;
                                    qxfl.xsr = qxfltemp.xsr;
                                    qxfl.xcqx = qxfltemp.xcqx;
                                    qxfl.xlqd = qxfltemp.xlqd;
                                    qxfl.CreateDate = DateTime.Now;
                                    qxfl.CreateMan = MainHelper.User.UserName;
                                    //MainHelper.PlatformSqlMap.Create<PJ_06sbxs>(qxfl);

                                    //WF_ModleRecordWorkTaskIns mrwt = new WF_ModleRecordWorkTaskIns();
                                    //mrwt.ModleRecordID = qxfl.ID;
                                    //mrwt.RecordID = lpr.ID;
                                    //mrwt.WorkFlowId = recordWorkFlowData.Rows[0]["WorkFlowId"].ToString();
                                    //mrwt.WorkFlowInsId = recordWorkFlowData.Rows[0]["WorkFlowInsId"].ToString();
                                    //mrwt.WorkTaskId = recordWorkFlowData.Rows[0]["WorkTaskId"].ToString();
                                    //mrwt.ModleTableName = qxfl.GetType().ToString();
                                    //mrwt.WorkTaskInsId = recordWorkFlowData.Rows[0]["WorkTaskInsId"].ToString();
                                    //mrwt.CreatTime = DateTime.Now;
                                    //MainHelper.PlatformSqlMap.Create<WF_ModleRecordWorkTaskIns>(mrwt);
                                }
                            }
                            else
                            {
                                qxfl = new PJ_06sbxsmx();
                                qxfl.OrgCode = MainHelper.UserOrg.OrgCode;
                                qxfl.OrgName = MainHelper.UserOrg.OrgName;
                                qxfl.CreateDate = DateTime.Now;
                                qxfl.CreateMan = MainHelper.User.UserName;
                                //MainHelper.PlatformSqlMap.Create<PJ_06sbxs>(qxfl);

                                //WF_ModleRecordWorkTaskIns mrwt = new WF_ModleRecordWorkTaskIns();
                                //mrwt.ModleRecordID = qxfl.ID;
                                //mrwt.RecordID = lpr.ID;
                                //mrwt.WorkFlowId = recordWorkFlowData.Rows[0]["WorkFlowId"].ToString();
                                //mrwt.WorkFlowInsId = recordWorkFlowData.Rows[0]["WorkFlowInsId"].ToString();
                                //mrwt.WorkTaskId = recordWorkFlowData.Rows[0]["WorkTaskId"].ToString();
                                //mrwt.ModleTableName = qxfl.GetType().ToString();
                                //mrwt.WorkTaskInsId = recordWorkFlowData.Rows[0]["WorkTaskInsId"].ToString();
                                //mrwt.CreatTime = DateTime.Now;
                                //MainHelper.PlatformSqlMap.Create<WF_ModleRecordWorkTaskIns>(mrwt);

                            }

                            ((frmWorkFlow06sbxsEdit)obj).RowData = qxfl;

                        }
                        else if (obj is frm08SBTDJXWorkFlowEdit)
                        {
                            IList<WF_ModleRecordWorkTaskIns> li = MainHelper.PlatformSqlMap.GetListByWhere<WF_ModleRecordWorkTaskIns>(" where RecordID='" + lpr.ID + "'"
                             + " and  WorkFlowId='" + recordWorkFlowData.Rows[0]["WorkFlowId"].ToString() + "' and ModleTableName='Ebada.Scgl.Model.PJ_qxfl'"
                               + " and  WorkFlowInsId='" + recordWorkFlowData.Rows[0]["WorkFlowInsId"].ToString() + "' order by CreatTime desc");
                            PJ_08sbtdjx qxfl = new PJ_08sbtdjx();
                            if (li.Count > 0)
                            {
                                PJ_qxfl qxfltemp = MainHelper.PlatformSqlMap.GetOneByKey<PJ_qxfl>(li[0].ModleRecordID);
                                li = MainHelper.PlatformSqlMap.GetListByWhere<WF_ModleRecordWorkTaskIns>(" where RecordID='" + lpr.ID + "'"
                               + " and  WorkFlowId='" + recordWorkFlowData.Rows[0]["WorkFlowId"].ToString() + "' and ModleTableName='Ebada.Scgl.Model.PJ_08sbtdjx'"
                                 + " and  WorkFlowInsId='" + recordWorkFlowData.Rows[0]["WorkFlowInsId"].ToString() + "' order by CreatTime desc");
                                if (li.Count > 0)
                                {
                                    qxfl = MainHelper.PlatformSqlMap.GetOneByKey<PJ_08sbtdjx>(li[0].ModleRecordID);
                                }
                                else
                                {
                                    qxfl.OrgCode = qxfltemp.OrgCode;
                                    qxfl.OrgName = qxfltemp.OrgName;
                                    qxfl.LineID = qxfltemp.LineID;
                                    qxfl.LineName = qxfltemp.LineName;
                                    qxfl.jxnr = qxfltemp.qxnr;
                                    if (qxfltemp.qxlb == "紧急缺陷")
                                    {
                                        qxfl.tdxz = "事故停电";
                                    }
                                    else
                                        if (qxfltemp.qxlb == "重大缺陷")
                                        {
                                            qxfl.tdxz = "临时停电";
                                        }
                                        else
                                            if (qxfltemp.qxlb == "一般缺陷")
                                            {
                                                qxfl.tdxz = "一般缺陷";
                                            }
                                    qxfl.CreateDate = DateTime.Now;
                                    qxfl.CreateMan = MainHelper.User.UserName;
                                    MainHelper.PlatformSqlMap.Create<PJ_08sbtdjx>(qxfl);

                                    WF_ModleRecordWorkTaskIns mrwt = new WF_ModleRecordWorkTaskIns();
                                    mrwt.ModleRecordID = qxfl.ID;
                                    mrwt.RecordID = lpr.ID;
                                    mrwt.WorkFlowId = recordWorkFlowData.Rows[0]["WorkFlowId"].ToString();
                                    mrwt.WorkFlowInsId = recordWorkFlowData.Rows[0]["WorkFlowInsId"].ToString();
                                    mrwt.WorkTaskId = recordWorkFlowData.Rows[0]["WorkTaskId"].ToString();
                                    mrwt.ModleTableName = qxfl.GetType().ToString();
                                    mrwt.WorkTaskInsId = recordWorkFlowData.Rows[0]["WorkTaskInsId"].ToString();
                                    mrwt.CreatTime = DateTime.Now;
                                    MainHelper.PlatformSqlMap.Create<WF_ModleRecordWorkTaskIns>(mrwt);
                                }

                            }
                            else
                            {
                                qxfl = new PJ_08sbtdjx();
                                qxfl.OrgCode = MainHelper.UserOrg.OrgCode;
                                qxfl.OrgName = MainHelper.UserOrg.OrgName;
                                qxfl.CreateDate = DateTime.Now;
                                string str = " where RecordID='" + lpr.ID + "'"
                             + " and  FieldName='类别' order by id";
                                WF_TableFieldValue mrv = MainHelper.PlatformSqlMap.GetOne<WF_TableFieldValue>(str
                                 );
                                //qxfl = new PJ_24();
                                if (mrv != null)
                                {
                                    qxfl.tdxz = mrv.ControlValue;
                                }
                                MainHelper.PlatformSqlMap.Create<PJ_08sbtdjx>(qxfl);

                                WF_ModleRecordWorkTaskIns mrwt = new WF_ModleRecordWorkTaskIns();
                                mrwt.ModleRecordID = qxfl.ID;
                                mrwt.RecordID = lpr.ID;
                                mrwt.WorkFlowId = recordWorkFlowData.Rows[0]["WorkFlowId"].ToString();
                                mrwt.WorkFlowInsId = recordWorkFlowData.Rows[0]["WorkFlowInsId"].ToString();
                                mrwt.WorkTaskId = recordWorkFlowData.Rows[0]["WorkTaskId"].ToString();
                                mrwt.ModleTableName = qxfl.GetType().ToString();
                                mrwt.WorkTaskInsId = recordWorkFlowData.Rows[0]["WorkTaskInsId"].ToString();
                                mrwt.CreatTime = DateTime.Now;
                                MainHelper.PlatformSqlMap.Create<WF_ModleRecordWorkTaskIns>(mrwt);

                            }

                            ((frm08SBTDJXWorkFlowEdit)obj).RowData = qxfl;

                        }
                        else if (obj is frmsgzaycWorkFlowEdit)
                        {
                            IList<WF_ModleRecordWorkTaskIns> li = MainHelper.PlatformSqlMap.GetListByWhere<WF_ModleRecordWorkTaskIns>(" where RecordID='" + lpr.ID + "'"
                             + " and  WorkFlowId='" + recordWorkFlowData.Rows[0]["WorkFlowId"].ToString() + "' and ModleTableName='Ebada.Scgl.Model.PJ_08sbtdjx'"
                               + " and  WorkFlowInsId='" + recordWorkFlowData.Rows[0]["WorkFlowInsId"].ToString() + "' order by CreatTime desc");
                            PJ_04sgzayc qxfl = new PJ_04sgzayc();
                            if (li.Count > 0)
                            {
                                PJ_08sbtdjx qxfltemp = MainHelper.PlatformSqlMap.GetOneByKey<PJ_08sbtdjx>(li[0].ModleRecordID);
                                qxfl.OrgCode = qxfltemp.OrgCode;
                                qxfl.OrgName = qxfltemp.OrgName;
                                qxfl.sdsj = qxfltemp.sdsj;
                                qxfl.tdsj = qxfltemp.tdsj;
                                qxfl.gtdsj = "";
                                TimeSpan span = qxfl.sdsj.Subtract(qxfl.tdsj);
                                if (span.Days > 0)
                                    qxfl.gtdsj += span.Days + "天";
                                if (span.Hours > 0)
                                    qxfl.gtdsj += span.Hours + "时";
                                if (span.Minutes > -1)
                                    qxfl.gtdsj += span.Minutes + "分";
                                qxfl.fsdd = qxfltemp.jxnr;
                                qxfl.CreateDate = DateTime.Now;
                                MainHelper.PlatformSqlMap.Create<PJ_04sgzayc>(qxfl);

                                WF_ModleRecordWorkTaskIns mrwt = new WF_ModleRecordWorkTaskIns();
                                mrwt.ModleRecordID = qxfl.ID;
                                mrwt.RecordID = lpr.ID;
                                mrwt.WorkFlowId = recordWorkFlowData.Rows[0]["WorkFlowId"].ToString();
                                mrwt.WorkFlowInsId = recordWorkFlowData.Rows[0]["WorkFlowInsId"].ToString();
                                mrwt.WorkTaskId = recordWorkFlowData.Rows[0]["WorkTaskId"].ToString();
                                mrwt.ModleTableName = qxfl.GetType().ToString();
                                mrwt.WorkTaskInsId = recordWorkFlowData.Rows[0]["WorkTaskInsId"].ToString();
                                mrwt.CreatTime = DateTime.Now;
                                MainHelper.PlatformSqlMap.Create<WF_ModleRecordWorkTaskIns>(mrwt);

                            }
                            else
                            {
                                qxfl = new PJ_04sgzayc();
                                qxfl.OrgCode = MainHelper.UserOrg.OrgCode;
                                qxfl.OrgName = MainHelper.UserOrg.OrgName;
                                MainHelper.PlatformSqlMap.Create<PJ_04sgzayc>(qxfl);

                                WF_ModleRecordWorkTaskIns mrwt = new WF_ModleRecordWorkTaskIns();
                                mrwt.ModleRecordID = qxfl.ID;
                                mrwt.RecordID = lpr.ID;
                                mrwt.WorkFlowId = recordWorkFlowData.Rows[0]["WorkFlowId"].ToString();
                                mrwt.WorkFlowInsId = recordWorkFlowData.Rows[0]["WorkFlowInsId"].ToString();
                                mrwt.WorkTaskId = recordWorkFlowData.Rows[0]["WorkTaskId"].ToString();
                                mrwt.ModleTableName = qxfl.GetType().ToString();
                                mrwt.WorkTaskInsId = recordWorkFlowData.Rows[0]["WorkTaskInsId"].ToString();
                                mrwt.CreatTime = DateTime.Now;
                                MainHelper.PlatformSqlMap.Create<WF_ModleRecordWorkTaskIns>(mrwt);
                            }

                            ((frmsgzaycWorkFlowEdit)obj).RowData = qxfl;

                        }
                        else if (obj is frmTDJHWorkFlowEdit)
                        {
                            IList<WF_ModleRecordWorkTaskIns> li = MainHelper.PlatformSqlMap.GetListByWhere<WF_ModleRecordWorkTaskIns>(" where RecordID='" + lpr.ID + "'"
                             + " and  WorkFlowId='" + recordWorkFlowData.Rows[0]["WorkFlowId"].ToString() + "' and ModleTableName='Ebada.Scgl.Model.PJ_tdjh'"
                               + " and  WorkFlowInsId='" + recordWorkFlowData.Rows[0]["WorkFlowInsId"].ToString() + "' order by CreatTime desc");
                            PJ_tdjh qxfl = new PJ_tdjh();
                            if (li.Count > 0)
                            {
                                qxfl = MainHelper.PlatformSqlMap.GetOneByKey<PJ_tdjh>(li[0].ModleRecordID);

                            }
                            else
                            {
                                li = MainHelper.PlatformSqlMap.GetListByWhere<WF_ModleRecordWorkTaskIns>(" where RecordID='" + lpr.ID + "'"
                             + " and  WorkFlowId='" + recordWorkFlowData.Rows[0]["WorkFlowId"].ToString() + "' and ModleTableName='Ebada.Scgl.Model.PJ_qxfl'"
                               + " and  WorkFlowInsId='" + recordWorkFlowData.Rows[0]["WorkFlowInsId"].ToString() + "' order by CreatTime desc");
                                qxfl = new PJ_tdjh();
                                if (li.Count > 0)
                                {
                                    PJ_qxfl qxfltemp = MainHelper.PlatformSqlMap.GetOneByKey<PJ_qxfl>(li[0].ModleRecordID);
                                    qxfl.OrgCode = qxfltemp.OrgCode;
                                    qxfl.SQOrgname = qxfltemp.OrgName;
                                    qxfl.OrgName = qxfltemp.OrgName;
                                    qxfl.JXNR = qxfltemp.qxnr;
                                    qxfl.S1 = "缺陷管理流程";
                                }
                                else
                                {
                                    qxfl.OrgCode = MainHelper.UserOrg.OrgCode;
                                    qxfl.OrgName = MainHelper.UserOrg.OrgName;
                                }
                                MainHelper.PlatformSqlMap.Create<PJ_tdjh>(qxfl);

                                WF_ModleRecordWorkTaskIns mrwt = new WF_ModleRecordWorkTaskIns();
                                mrwt.ModleRecordID = qxfl.ID;
                                mrwt.RecordID = lpr.ID;
                                mrwt.WorkFlowId = recordWorkFlowData.Rows[0]["WorkFlowId"].ToString();
                                mrwt.WorkFlowInsId = recordWorkFlowData.Rows[0]["WorkFlowInsId"].ToString();
                                mrwt.WorkTaskId = recordWorkFlowData.Rows[0]["WorkTaskId"].ToString();
                                mrwt.ModleTableName = qxfl.GetType().ToString();
                                mrwt.WorkTaskInsId = recordWorkFlowData.Rows[0]["WorkTaskInsId"].ToString();
                                mrwt.CreatTime = DateTime.Now;
                                MainHelper.PlatformSqlMap.Create<WF_ModleRecordWorkTaskIns>(mrwt);
                            }

                            ((frmTDJHWorkFlowEdit)obj).RowData = qxfl;

                        }
                        else if (obj is frm24WorkFlowEdit)
                        {
                            IList<WF_ModleRecordWorkTaskIns> li = MainHelper.PlatformSqlMap.GetListByWhere<WF_ModleRecordWorkTaskIns>(" where RecordID='" + lpr.ID + "'"
                             + " and  WorkFlowId='" + recordWorkFlowData.Rows[0]["WorkFlowId"].ToString() + "' and ModleTableName='Ebada.Scgl.Model.PJ_24'"
                               + " and  WorkFlowInsId='" + recordWorkFlowData.Rows[0]["WorkFlowInsId"].ToString() + "' order by CreatTime desc");
                            PJ_24 qxfl = new PJ_24();
                            if (li.Count > 0)
                            {
                                qxfl = MainHelper.PlatformSqlMap.GetOneByKey<PJ_24>(li[0].ModleRecordID);

                            }
                            else
                            {
                                string str = " where RecordID='" + lpr.ID + "'"
                             + " and  FieldName='申请原因' order by id";
                                WF_TableFieldValue mrv = MainHelper.PlatformSqlMap.GetOne<WF_TableFieldValue>(str
                              );
                                //qxfl = new PJ_24();
                                if (mrv != null)
                                {
                                    qxfl.nr = mrv.ControlValue;
                                }
                                str = " where RecordID='" + lpr.ID + "'"
                              + " and  FieldName='供电所名称' order by id";
                                mrv = MainHelper.PlatformSqlMap.GetOne<WF_TableFieldValue>(str
                               );
                                //qxfl = new PJ_24();
                                if (mrv != null)
                                {
                                    mOrg org = MainHelper.PlatformSqlMap.GetOne<mOrg>(" where orgname='" + mrv.ControlValue + "'");
                                    if (org != null)
                                        qxfl.ParentID = org.OrgID;
                                }
                                qxfl.CreateDate = DateTime.Now;
                                qxfl.CreateMan = MainHelper.User.UserName;
                                if (qxfl.BigData == null || qxfl.BigData.Length == 0)
                                {
                                    qxfl.BigData = new byte[0];
                                }
                                MainHelper.PlatformSqlMap.Create<PJ_24>(qxfl);

                                WF_ModleRecordWorkTaskIns mrwt = new WF_ModleRecordWorkTaskIns();
                                mrwt.ModleRecordID = qxfl.ID;
                                mrwt.RecordID = lpr.ID;
                                mrwt.WorkFlowId = recordWorkFlowData.Rows[0]["WorkFlowId"].ToString();
                                mrwt.WorkFlowInsId = recordWorkFlowData.Rows[0]["WorkFlowInsId"].ToString();
                                mrwt.WorkTaskId = recordWorkFlowData.Rows[0]["WorkTaskId"].ToString();
                                mrwt.ModleTableName = qxfl.GetType().ToString();
                                mrwt.WorkTaskInsId = recordWorkFlowData.Rows[0]["WorkTaskInsId"].ToString();
                                mrwt.CreatTime = DateTime.Now;
                                MainHelper.PlatformSqlMap.Create<WF_ModleRecordWorkTaskIns>(mrwt);
                            }

                            ((frm24WorkFlowEdit)obj).RowData = qxfl;

                        }


                        if (((Form)obj).ShowDialog() == DialogResult.OK)
                        {
                            if (obj is WorkFlowLineSelectForm)
                            {
                                workFlowFormShow(lpr);
                            }
                        }
                    }
                InitData(strKind);
            }
            /*
                        IList wfli = MainHelper.PlatformSqlMap.GetList("SelectOneStr", " select distinct tlcid from WF_WorkTastTrans where slcid='" +
                                     recordWorkFlowData.Rows[0]["WorkFlowId"]
                                     + "' and cdfs like '下拉%' ");
                        foreach (string strwf in wfli) {
                            WF_WorkFlow wf = MainHelper.PlatformSqlMap.GetOneByKey<WF_WorkFlow>(strwf);
                            LP_Record lp = new LP_Record();
                            lp.ID = "N" + lp.CreateID();
                            lp.Kind = wf.FlowCaption;
                            lp.CreateTime = DateTime.Now.ToString();
                            lp.OrgName = MainHelper.UserOrg.OrgName;
                            lp.ParentID = lpr.ID;
                            RecordWorkTask.RunNewGZPRecord(lp.ID, lp.Kind, MainHelper.User.UserID, false);
                            DataTable dttemp = RecordWorkTask.GetRecordWorkFlowData(lp.ID, MainHelper.User.UserID);
                            lp.Number = RecordWorkTask.CreatWorkFolwNo(MainHelper.UserOrg, "", lp.Kind);
                            lp.Status = dttemp.Rows[0]["TaskCaption"].ToString();
                            MainHelper.PlatformSqlMap.Create<LP_Record>(lp);
                            Thread.Sleep(new TimeSpan(100000));//0.1毫秒
                        }*/
            //获得编辑按钮的状态
            this.btEditfrm.Caption = lpr.Status;
        }
Ejemplo n.º 12
0
        void gridViewOperation_AfterAdd(PJ_06sbxs newobj)
        {
            WF_ModleRecordWorkTaskIns mrwt = new WF_ModleRecordWorkTaskIns();
            if (isWorkflowCall)
            {

                mrwt.ModleRecordID = newobj.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 = newobj.GetType().ToString();
                mrwt.WorkTaskInsId = WorkFlowData.Rows[0]["WorkTaskInsId"].ToString();
                mrwt.CreatTime = DateTime.Now;
                MainHelper.PlatformSqlMap.Create<WF_ModleRecordWorkTaskIns>(mrwt);
                //currRecord.DocContent = newobj.BigData;
                //MainHelper.PlatformSqlMap.Update<LP_Record>(currRecord);

            }
            if (newobj.qxlb != "")
            {
                PJ_qxfl qxfj = new PJ_qxfl();
                qxfj.ID = newobj.ID;
                qxfj.CreateDate = newobj.CreateDate;
                qxfj.CreateMan = newobj.CreateMan;
                qxfj.LineID = newobj.LineID;
                qxfj.LineName = newobj.LineName;
                qxfj.OrgCode = newobj.OrgCode;
                qxfj.OrgName = newobj.OrgName;
                qxfj.qxlb = newobj.qxlb;
                qxfj.qxly = "设备巡视";
                qxfj.qxnr = newobj.qxnr;
                qxfj.xcqx = newobj.xcqx;
                qxfj.xcr = newobj.xcr;
                qxfj.xlqd = newobj.xlqd;
                qxfj.xsr = newobj.xsr;
                qxfj.xssj = newobj.xssj;
                MainHelper.PlatformSqlMap.Create<PJ_qxfl>(qxfj);




                Thread.Sleep(new TimeSpan(100000));//0.1毫秒
                mrwt = new WF_ModleRecordWorkTaskIns();
                mrwt.ID = mrwt.CreateID();
                mrwt.ModleRecordID = qxfj.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 = qxfj.GetType().ToString();
                mrwt.WorkTaskInsId = WorkFlowData.Rows[0]["WorkTaskInsId"].ToString();
                mrwt.CreatTime = DateTime.Now;
                MainHelper.PlatformSqlMap.Create<WF_ModleRecordWorkTaskIns>(mrwt);
            }
        }
Ejemplo n.º 13
0
        private void AddQx(PJ_13dlbhjl obj)
        {
            if (obj.yxqk != "正常")
            {
                MainHelper.PlatformSqlMap.DeleteByKey<PJ_qxfl>(obj.ID);

                PS_tqdlbh ps_tq = ClientHelper.PlatformSqlMap.GetOne<PS_tqdlbh>(" where sbid='" + parentID + "'");

                PJ_qxfl mx = new PJ_qxfl();
                mx.ID = obj.ID;
                mx.OrgCode = obj.OrgCode;
                mx.OrgName = obj.OrgName;
                mx.LineID = "09";
                mx.LineName = ps_tq.InstallAdress;
                mx.xlqd = ps_tq.InstallAdress;
                mx.xssj = obj.CreateDate;
                mx.xsr = obj.csr;
                mx.qxly = "剩余电流动作保护器";
                mx.qxnr = "剩余电流动作保护器" + obj.yxqk;
                mx.qxlb = "紧急缺陷";
                mx.xcqx = mx.xssj.AddDays(3).ToShortDateString();

                //lgmqxlast
                mx.tqid = ps_tq.tqID;
                mx.tqname = ps_tq.tqName;
                MainHelper.PlatformSqlMap.Create<PJ_qxfl>(mx);
            }
        }
Ejemplo n.º 14
0
        //处理缺陷明细  lgmqx
        private void Addqxmx(PJ_05jckyjl obj)
        {
            PJ_qxfl tempobj = MainHelper.PlatformSqlMap.GetOneByKey<PJ_qxfl>(obj.ID);
            if (obj.jr != "合格")
            {
                if (tempobj == null || tempobj.xcr == string.Empty)
                {
                    MainHelper.PlatformSqlMap.DeleteByKey<PJ_qxfl>(obj.ID);
                    PJ_qxfl mx = new PJ_qxfl();
                    mx.ID = obj.ID;
                    mx.OrgCode = parentObj.OrgCode;
                    mx.OrgName = parentObj.OrgName;
                    mx.LineID = "06";
                    mx.LineName = parentObj.LineID;
                    mx.xlqd = parentObj.gtID;
                    mx.xssj = obj.clrq;
                    mx.xsr = obj.clrqz;
                    mx.qxly = "交叉跨越及对地距离测量记录";
                    mx.qxnr = "交叉跨越及对地距离测量不合格";
                    //lgmqxlast
                    mx.xlid = obj.xlid;
                    mx.xlname = obj.xlname;
                    mx.tqid = obj.tqid;
                    mx.tqname = obj.tqname;
                    mx.byqid = obj.byqid;
                    mx.byqname = obj.byqname;
                    mx.kgid = obj.kgid;
                    mx.kgname = obj.kgname;
                    

                    if (obj.scz<parentObj.gdjl*0.5M)
                    {
                        mx.qxlb = "重大缺陷";
                        mx.xcqx = mx.xssj.AddDays(3).ToShortDateString();
                    }
                    else
	                {
                        mx.qxlb = "一般缺陷";
                        mx.xcqx = mx.xssj.AddMinutes(3).ToShortDateString();
	                }
                    
                    MainHelper.PlatformSqlMap.Create<PJ_qxfl>(mx);
                }

            }
            else
            {
                if (tempobj != null && tempobj.xcr == string.Empty)
                {
                    MainHelper.PlatformSqlMap.DeleteByKey<PJ_qxfl>(obj.ID);
                }

            }

        }
Ejemplo n.º 15
0
        private void btEditfrm_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) {
            if (gridView1.FocusedRowHandle < 0) {
                return;
            }
            DataRow dr = gridView1.GetDataRow(gridView1.FocusedRowHandle);
            LP_Record currRecord = new LP_Record();
            foreach (DataColumn dc in gridtable.Columns) {
                if (dc.ColumnName != "Image") {
                    if (dc.DataType.FullName.IndexOf("Byte[]") < 0)
                        currRecord.GetType().GetProperty(dc.ColumnName).SetValue(currRecord, dr[dc.ColumnName], null);
                    else if (dc.DataType.FullName.IndexOf("Byte[]") > -1 && DBNull.Value != dr[dc.ColumnName] && dr[dc.ColumnName].ToString() != "")
                        currRecord.GetType().GetProperty(dc.ColumnName).SetValue(currRecord, dr[dc.ColumnName], null);

                }
            }
            DataTable dt = RecordWorkTask.GetRecordWorkFlowData(currRecord.ID, MainHelper.User.UserID);

            if (!RecordWorkTask.HaveRunRecordRole(currRecord.ID, MainHelper.User.UserID)) return;
            object obj = RecordWorkTask.GetWorkTaskModle(dt);
            if (obj == null) {
                return;
            }

            if (obj is frmLP) {
                frmLP frm = new frmLP();
                frm.Status = "edit";


                frm.CurrRecord = currRecord;


                frm.ParentTemple = RecordWorkTask.GetWorkTaskTemple(dt, currRecord);
                if (frm.ParentTemple == null) {
                    MsgBox.ShowWarningMessageBox("出错,未找到该节点关联的表单,请检查模板设置!");
                    //return;
                }

                frm.Kind = strKind;
                frm.RecordWorkFlowData = dt;
                if (frm.ShowDialog() == DialogResult.OK) {
                    InitData(strSQL);
                }
            } else {



                if (obj.GetType().GetProperty("IsWorkflowCall") != null)
                    obj.GetType().GetProperty("IsWorkflowCall").SetValue(obj, true, null);
                else {
                    MsgBox.ShowWarningMessageBox("模块不支持,请咨询开发人员!");
                    return;
                }
                if (obj.GetType().GetProperty("CurrRecord") != null)
                    obj.GetType().GetProperty("CurrRecord").SetValue(obj, currRecord, null);
                else {
                    MsgBox.ShowWarningMessageBox("模块不支持,请咨询开发人员!");
                    return;
                }
                if (obj.GetType().GetProperty("RecordWorkFlowData") != null)
                    obj.GetType().GetProperty("RecordWorkFlowData").SetValue(obj, dt, null);
                else {
                    MsgBox.ShowWarningMessageBox("模块不支持,请咨询开发人员!");
                    return;
                }
                if (obj.GetType().GetProperty("ParentTemple") != null)
                    obj.GetType().GetProperty("ParentTemple").SetValue(obj, RecordWorkTask.GetWorkTaskTemple(dt, currRecord), null);
                else {
                    MsgBox.ShowWarningMessageBox("模块不支持,请咨询开发人员!");
                    return;
                }
                if (obj is UserControl) {

                    FormBase dlg = new FormBase();
                    dlg.Text = ((UserControl)obj).Name;
                    dlg.MdiParent = MainHelper.MainForm;
                    dlg.Controls.Add((UserControl)obj);
                    ((UserControl)obj).Dock = DockStyle.Fill;
                    dlg.Show();
                } else
                    if (obj is Form) {
                        if (obj is frmyxfxWorkFlowEdit) {
                            IList<WF_ModleRecordWorkTaskIns> li = MainHelper.PlatformSqlMap.GetListByWhere<WF_ModleRecordWorkTaskIns>(" where RecordID='" + currRecord.ID + "'"
                             + " and  WorkFlowId='" + dt.Rows[0]["WorkFlowId"].ToString() + "'"
                               + " and  WorkFlowInsId='" + dt.Rows[0]["WorkFlowInsId"].ToString() + "' order by CreatTime desc");
                            PJ_03yxfx yxfx = new PJ_03yxfx();
                            if (li.Count > 0) {
                                yxfx = MainHelper.PlatformSqlMap.GetOneByKey<PJ_03yxfx>(li[0].ModleRecordID);

                            } else {
                                yxfx = new PJ_03yxfx();
                                yxfx.OrgCode = MainHelper.UserOrg.OrgCode;
                                yxfx.OrgName = MainHelper.UserOrg.OrgName;
                                if (parentObj.FlowCaption.IndexOf("定期分析") > 0)
                                    yxfx.type = "定期分析";
                                else
                                    if (parentObj.FlowCaption.IndexOf("专题分析") > 0)
                                        yxfx.type = "专题分析";
                                ((frmyxfxWorkFlowEdit)obj).RecordStatus = 0;
                                yxfx.rq = DateTime.Now;
                                ((frmyxfxWorkFlowEdit)obj).RowData = yxfx;
                            }
                            switch (dt.Rows[0]["TaskInsCaption"].ToString()) {
                                case "填写":
                                    ((frmyxfxWorkFlowEdit)obj).RecordStatus = 0;
                                    break;
                                case "领导检查":
                                    ((frmyxfxWorkFlowEdit)obj).RecordStatus = 1;
                                    break;
                                case "检查人检查":
                                    ((frmyxfxWorkFlowEdit)obj).RecordStatus = 2;
                                    break;

                            }
                            yxfx.rq = DateTime.Now;
                            ((frmyxfxWorkFlowEdit)obj).RowData = yxfx;

                        } else if (obj is frmsbqxWorkFlowEdit) {
                            IList<WF_ModleRecordWorkTaskIns> li = MainHelper.PlatformSqlMap.GetListByWhere<WF_ModleRecordWorkTaskIns>(" where RecordID='" + currRecord.ID + "'"
                             + " and  WorkFlowId='" + dt.Rows[0]["WorkFlowId"].ToString() + "'"
                               + " and  WorkFlowInsId='" + dt.Rows[0]["WorkFlowInsId"].ToString() + "' order by CreatTime desc");
                            PJ_qxfl qxfl = new PJ_qxfl();
                            if (li.Count > 0) {
                                qxfl = MainHelper.PlatformSqlMap.GetOneByKey<PJ_qxfl>(li[0].ModleRecordID);

                            } else {
                                qxfl = new PJ_qxfl();
                                qxfl.OrgCode = MainHelper.UserOrg.OrgCode;
                                qxfl.OrgName = MainHelper.UserOrg.OrgName;

                            }

                            ((frmsbqxWorkFlowEdit)obj).RowData = qxfl;

                        }
                        ((Form)obj).ShowDialog();
                    }
                InitData(strSQL);
            }
            //获得编辑按钮的状态
            this.btEditfrm.Caption = currRecord.Status;
        }
Ejemplo n.º 16
0
        //处理缺陷明细  lgmqx
        private void Addqxmx(PJ_06sbxsmx obj)
        {
            PJ_qxfl tempobj = MainHelper.PlatformSqlMap.GetOneByKey<PJ_qxfl>(obj.ID);
            if (obj.xcr == string.Empty)
            {
                if (tempobj == null || tempobj.xcr == string.Empty)
                {
                    MainHelper.PlatformSqlMap.DeleteByKey<PJ_qxfl>(obj.ID);
                    PJ_qxfl mx = new PJ_qxfl();
                    mx.ID = obj.ID;
                    mx.OrgCode = obj.OrgCode;
                    mx.OrgName = obj.OrgName;
                    mx.LineID = "07";
                    mx.LineName = obj.LineName;
                    mx.xlqd = obj.xlqd;
                    mx.xssj = obj.xssj;
                    mx.xsr = obj.xsr;
                    mx.qxly = "设备巡视及缺陷消除记录";
                    mx.qxnr = obj.qxnr;
                    mx.qxlb = obj.qxlb;
                    mx.xcqx = obj.xcqx;
                    //lgmqxlast
                    mx.xlid = obj.xlid;
                    mx.xlname = obj.xlname;
                    mx.tqid = obj.tqid;
                    mx.tqname = obj.tqname;
                    mx.byqid = obj.byqid;
                    mx.byqname = obj.byqname;
                    mx.kgid = obj.kgid;
                    mx.kgname = obj.kgname;
                   
                    MainHelper.PlatformSqlMap.Create<PJ_qxfl>(mx);
                }

            }
            else
            {
                if (tempobj != null && tempobj.xcr == string.Empty)
                {
                    MainHelper.PlatformSqlMap.DeleteByKey<PJ_qxfl>(obj.ID);
                }

            }

        }
Ejemplo n.º 17
0
        /// <summary>
        /// 新建对象设置Key值
        /// </summary>
        /// <param name="newobj"></param>
        void gridViewOperation_CreatingObjectEvent(PJ_qxfl newobj)
        {
            if (parentID == null) return;
            newobj.OrgCode = parentID;
            newobj.OrgName = parentObj.OrgName;
            newobj.CreateDate = DateTime.Now;
            Ebada.Core.UserBase m_UserBase = MainHelper.ValidateLogin();
            newobj.CreateMan = m_UserBase.RealName;
            newobj.xssj = DateTime.Now;

            //if (isWorkflowCall)
            //{
            //    WF_ModleRecordWorkTaskIns mrwt = new WF_ModleRecordWorkTaskIns();
            //    mrwt.ModleRecordID = newobj.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 = newobj.GetType().ToString();
            //    mrwt.WorkTaskInsId = WorkFlowData.Rows[0]["WorkTaskInsId"].ToString();
            //    mrwt.CreatTime = DateTime.Now;
            //    MainHelper.PlatformSqlMap.Create<WF_ModleRecordWorkTaskIns>(mrwt);
            //}
            try { frmLP.ReadTaskData(newobj, RecordWorkFlowData, ParentTemple, CurrRecord); }
            catch { }
        }
Ejemplo n.º 18
0
        public static void update(PJ_06sbxsmx qxjl) {
           PJ_06sbxsmx sbxs = qxjl;
            string strmes = "";
            object obj = MainHelper.PlatformSqlMap.GetOneByKey<PJ_06sbxsmx>(sbxs.ID);
            PJ_qxfl qxfj = new PJ_qxfl();
            if (obj == null) {
                obj = MainHelper.PlatformSqlMap.GetOne<PJ_06sbxs>("where  OrgCode='" + sbxs.OrgCode + "' and  LineID='" + sbxs.LineID + "' and xlqd='" + sbxs.xlqd + "'");
                if (obj == null) {
                    PJ_06sbxs sbxstemp = new PJ_06sbxs();
                    sbxstemp.OrgCode = sbxs.OrgCode;
                    sbxstemp.OrgName = sbxs.OrgName;
                    sbxstemp.LineID = sbxs.LineID;
                    sbxstemp.LineName = sbxs.LineName;
                    sbxstemp.xlqd = sbxs.xlqd;
                    sbxstemp.xssj = DateTime.Now;
                    sbxstemp.CreateMan = MainHelper.User.UserName;
                    MainHelper.PlatformSqlMap.Create<PJ_06sbxs>(sbxstemp);
                    sbxs.ParentID = sbxstemp.ID;
                } else {
                    sbxs.ParentID = (obj as PJ_06sbxs).ID;
                }

                MainHelper.PlatformSqlMap.Create<PJ_06sbxsmx>(sbxs);
            } else {
                PJ_06sbxsmx qxfltemp = obj as PJ_06sbxsmx;
                qxfltemp.LineID = sbxs.LineID;
                qxfltemp.LineName = sbxs.LineName;
                qxfltemp.OrgCode = sbxs.OrgCode;
                qxfltemp.OrgName = sbxs.OrgName;
                qxfltemp.qxlb = sbxs.qxlb;
                qxfltemp.qxnr = sbxs.qxnr;
                qxfltemp.xssj = sbxs.xssj;
                qxfltemp.xsr = sbxs.xsr;
                qxfltemp.xcqx = sbxs.xcqx;
                qxfltemp.xlqd = sbxs.xlqd; ;
                qxfltemp.xcr = sbxs.xcr;
                qxfltemp.xcrq = sbxs.xcrq;
                MainHelper.PlatformSqlMap.Update<PJ_06sbxsmx>(qxfltemp);
            }
        }