protected void btnFinish_Click(object sender, EventArgs e)
    {
        string[] names     = hfFirstName.Value.Split(',');
        string[] lastnames = hflastName.Value.Split(',');
        string[] mails     = hfEmail.Value.Split(',');
        PaperInfoMan_Business paperInfoMan = new PaperInfoMan_Business();
        List <User_cls>       referees     = new List <User_cls>();

        for (int i = 0; i < names.Length - 1; i++)
        {
            if (names[i] != string.Empty && lastnames[i] != string.Empty && mails[i] != string.Empty)
            {
                referees.Add(new User_cls()
                {
                    Fname = names[i], Lname = lastnames[i], Email = mails[i]
                });
            }
        }
        int       paperID = System.Convert.ToInt32(FormBase.UrlDecode(Request[RequestMSG.SubmitOnline]));
        DBmessage dbm     = paperInfoMan.RegisterPaper_Step4(referees, paperID);

        if (dbm.Type == DBMessageType.Sucsess)
        {
            FormBase.SendRequest(ServerDirectory.Paper + "/PaperListAuthor.aspx", new string[] { RequestMSG.Msg, RequestMSG.Type }, new string[] { dbm.Message, dbm.Type.ToString() });
        }
        else
        {
            ShowNotify(dbm);
        }
    }
        private void mainForm_Load(
            object sender,
            EventArgs e)
        {
            DataProcessing.CanOverwrite += dataProcessing_CanOverwrite;

            WinFormsPersistanceHelper.RestoreState(
                this,
                new RestoreInformation
            {
                SuggestZoomPercent = 90,
                RespectWindowRatio = false
            });
            CenterToScreen();

            ribbon.SelectedPage = ribbonPage1;
            FormBase.RestoreState(ribbon);
            FormBase.RestoreState(mainFormMainSplitContainer);

            loadMruFileProjects();
            loadMruFileFiles();

            if (!handleProjectOnCommandLine())
            {
                projectFilesUserControl.LoadRecentProject();
            }

            Application.Idle += application_Idle;

            UpdateUI();
        }
Пример #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         UserAuthorizeMan_Business userAuthorize = new UserAuthorizeMan_Business();
         string nextURl = null;
         if (!string.IsNullOrEmpty(Request[RequestMSG.UserName]))
         {
             txtEmail.Text = FormBase.UrlDecode(Request[RequestMSG.UserName]);
         }
         if (!string.IsNullOrEmpty(Request[RequestMSG.NextURL]))
         {
             nextURl = FormBase.UrlDecode(Request[RequestMSG.NextURL]);
         }
         if (!string.IsNullOrEmpty(Request[RequestMSG.Password]))
         {
             txtPass.Text = FormBase.UrlDecode(Request[RequestMSG.Password]);
         }
         if (txtEmail.Text != string.Empty && txtPass.Text != string.Empty)
         {
             userAuthorize.Login(txtEmail.Text, txtPass.Text, nextURl);
         }
         if (SysProperty.Client.Roles[RoleType.User])
         {
             Response.Redirect(ServerDirectory.Host + "/Dashboard.aspx");
         }
     }
 }
Пример #4
0
    /// <summary>
    /// Handles MdiChildActivate event handler.
    /// </summary>
    /// <remarks>
    /// Validates whether current MDI may lose the focus. If validation failes,
    /// reactivates invalid MDI that is losing the focus.
    /// </remarks>
    ///
    private void ValidateMdiChildActivate()
    {
        Debug.TraceLine("MdiChildActivate:  {0}",
                        ActiveMdiChild == null ? "none" : ActiveMdiChild.Name);

        MyMdiForm myMdiForm = this.lastMdiChild as MyMdiForm;

        if (this.lastMdiChild != ActiveMdiChild && myMdiForm != null)
        {
            FormBase mdiForm = myMdiForm.Tag as FormBase;

            if (mdiForm != null && mdiForm.IsDirty())
            {
                // System.Media.SystemSounds.Beep.Play ();

                mdiForm.MdiForm.Activate();

                Debug.TraceLine("MdiChildActivate: Reactivated as dirty: {0}",
                                ActiveMdiChild == null ? "none" : ActiveMdiChild.Name);
            }
        }

        this.lastMdiChild = ActiveMdiChild;

        this.InfoMessage = ActiveMdiChild == null ? "Ready." : ActiveMdiChild.Text;
    }
Пример #5
0
        public FormBase Build()
        {
            FormBase form = new FormBase(this);

            SetupForm(form);
            return(form);
        }
Пример #6
0
 public FormBase this[string index]
 {
     get
     {
         FormBase retVal = null;
         if (dic.TryGetValue(index, out retVal))
         {
             return(retVal);
         }
         return(null);
     }
     set
     {
         FormBase retVal = null;
         if (value == null)
         {
             return;
         }
         if (dic.TryGetValue(index, out retVal))
         {
             try
             {
                 value.MyEventHandler -= MyEventHandler1;
             }
             catch
             {
             }
             retVal = value;
             retVal.MyEventHandler += MyEventHandler1;
             return;
         }
         value.MyEventHandler += MyEventHandler1;
         dic.Add(index, value);
     }
 }
        public async Task <IHttpActionResult> PutFormBase(int id, FormBase formBase)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != formBase.Id)
            {
                return(BadRequest());
            }

            _dbContext.Entry(formBase).State = EntityState.Modified;

            try
            {
                await _dbContext.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!FormBaseExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Пример #8
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="menuKey"></param>
        /// <param name="form"></param>
        /// <returns></returns>
        protected override FormBase ShowChildForm(FormBase form)
        {
            this.SuspendLayout();
            this.bpnlContainer.SuspendLayout();

            form.Left = 0;
            form.Top  = 0;
            form.Size = form.ChildSize;
            this.bpnlContainer.Size = form.ChildSize;

            if (this.bpnlContainer.Controls.Count > 0)
            {
                FormBase lastForm = (FormBase)this.bpnlContainer.Controls[this.bpnlContainer.Controls.Count - 1];
                lastForm.PerformDeactivated();
                lastForm.Visible = false;
            }

            this.bpnlContainer.Controls.Add(form);
            this.bpnlContainer.ResumeLayout();
            form.PerformActivated();

            // set main menu state
            EnableMainMenu(!form.IsModal, !form.HideMainMenu);
            FrameBaseData.Current.OnDataChanged(FrameBaseDataItem.ActiveTitle, form.Text);

            this.ResumeLayout();
            return(form);
        }
Пример #9
0
 // 遍历处理表单的所有控件
 public static void ProcessFormItems(FormBase form, Action <Field> process)
 {
     if (form is SimpleForm)
     {
         foreach (var item in form.Items)
         {
             if (item is FormBase)
             {
                 ProcessFormItems(item as FormBase, process);
             }
             else if (item is Field)
             {
                 process(item as Field);
             }
         }
     }
     if (form is Form)
     {
         var frm = form as Form;
         foreach (FormRow row in frm.Rows)
         {
             foreach (var item in row.Controls)
             {
                 if (item is FormBase)
                 {
                     ProcessFormItems(item as FormBase, process);
                 }
                 else if (item is Field)
                 {
                     process(item as Field);
                 }
             }
         }
     }
 }
Пример #10
0
 internal static void RegisterFormByType(string formUid, FormBase formBase)
 {
     if (!string.IsNullOrEmpty(formUid))
     {
         DicionarioFormEvent.Add(formUid, formBase);
     }
 }
Пример #11
0
        //-----------------------------------------------
        // 构建表单
        //-----------------------------------------------
        // 动态生成表单(返回“字段名-控件”字典)
        public static Dictionary <string, Field> BuildForm(FormBase form, UISetting ui, bool showIdField = false, bool readOnly = false)
        {
            var map = new Dictionary <string, Field>();

            foreach (var attr in ui.Settings)
            {
                if (attr.Field.Name == "ID" && !showIdField)
                {
                    continue;
                }
                if (attr.ShowInForm)
                {
                    // 根据 UIAttribute 创建控件
                    var editorType = GetDefaultEditorName(attr.Field.PropertyType, readOnly);
                    if (attr.Editor != EditorType.Auto)
                    {
                        editorType = attr.Editor;
                    }
                    string title  = string.IsNullOrEmpty(attr.Group) ? attr.Title : attr.Group + "-" + attr.Title;
                    var    editor = CreateEditor(attr.Field.Name, title, editorType, attr.EditRequired, attr.EditPrecision);

                    // 添加到表单并记录到字典
                    form.Items.Add(editor);
                    map.Add(attr.Field.Name, editor);
                }
            }
            return(map);
        }
Пример #12
0
        protected override void OnRenderSkinFormControlBox(SkinFormControlBoxRenderEventArgs e)
        {
            FormBase        form           = e.Form;
            Graphics        g              = e.Graphics;
            Rectangle       clipRectangle  = e.ClipRectangle;
            ControlBoxState controlBoxtate = e.ControlBoxtate;
            CmSysButton     cmSysButton    = e.CmSysButton;
            bool            active         = e.Active;
            bool            minimizeBox    = form.ControlBox && form.MinimizeBox;
            bool            maximizeBox    = form.ControlBox && form.MaximizeBox;

            switch (e.ControlBoxStyle)
            {
            case ControlBoxStyle.Minimize:
                this.RenderSkinFormMinimizeBoxInternal(g, clipRectangle, controlBoxtate, active, form);
                return;

            case ControlBoxStyle.Maximize:
                this.RenderSkinFormMaximizeBoxInternal(g, clipRectangle, controlBoxtate, active, minimizeBox, form.WindowState == FormWindowState.Maximized, form);
                return;

            case ControlBoxStyle.Close:
                this.RenderSkinFormCloseBoxInternal(g, clipRectangle, controlBoxtate, active, minimizeBox, maximizeBox, form);
                return;

            case ControlBoxStyle.CmSysBottom:
                this.RenderSkinFormCmSysBottomInternal(g, clipRectangle, controlBoxtate, active, form, cmSysButton);
                return;
            }
        }
Пример #13
0
 public SeleccionPersonaActiva(FormBase caller, string tipoP)
 {
     this.caller = caller;
     caller.Hide();
     tipo = tipoP;
     InitializeComponent();
 }
Пример #14
0
        //---------------------------------------------
        // 公有方法
        //---------------------------------------------
        /// <summary>
        /// 初始化表单。访问权限验证;生成工具栏按钮;请在OnInit事件中调用。
        /// </summary>
        /// <param name="form">页面中的表单</param>
        /// <param name="viewPower">查看权限</param>
        /// <param name="editPower">编辑权限</param>
        /// <param name="newPower">新建权限</param>
        /// <param name="toolbar">工具栏。按钮将在该工具栏中生成。若为空,则尝试在表单第一个工具栏中插入按钮。</param>
        /// <param name="relayoutToolbar">是否重新布局工具栏。为true的话将工具栏上的原控件移到右侧。</param>
        public void InitForm(FormBase form, PowerType viewPower, PowerType editPower, PowerType newPower, Toolbar toolbar = null, bool relayoutToolbar = true)
        {
            // 检测页面访问权限
            switch (this.Mode)
            {
            case PageMode.View: Common.CheckPagePower(viewPower); break;

            case PageMode.New: Common.CheckPagePower(newPower); break;

            case PageMode.Edit: Common.CheckPagePower(editPower); break;
            }

            // 工具栏
            this.frm = form;
            if (toolbar == null)
            {
                if (form.Toolbars.Count > 0)
                {
                    toolbar = form.Toolbars[0];
                }
                else
                {
                    toolbar = new Toolbar();
                    form.Toolbars.Add(toolbar);
                }
            }

            // 工具栏控件
            InitToolbar(toolbar, relayoutToolbar);
            this.ShowBtnClose = Asp.GetQueryBoolValue("showBtnClose") ?? false;
        }
Пример #15
0
        public static void ShowForm(FormBase form, FormBase parent)
        {
            form.Show();

            if (parent != null)
            {
                parent.Close();
            }
        }
Пример #16
0
        public void ToStringTest()
        {
            FormBase target = new FormBase();             // TODO: Initialize to an appropriate value

            target.Comments =
                @"Coolest secret agent in the world;

Played best by Sean Connery";

            target["Name"] = "BondJameBond";
            target.IsFieldMultiLine["Name"] = false;
            target["Property"] = "Shaken not stirred";
            target.IsFieldMultiLine["Property"] = false;
            target["Description"] = "Coolest secret agent in the world;/r/n/r/nPlayed best by Sean Connery";
            target.IsFieldMultiLine["Description"] = true;

            List <string> data = new List <string>(25);

            for (int idx = 0; idx < 25; idx++)
            {
                data.Add(null);
            }

            data[0]  = "Dr. No";
            data[1]  = "From Russia With Love";
            data[2]  = "Goldfinger";
            data[3]  = "Thunderball";
            data[4]  = "You Only Live Twice";
            data[5]  = "On Her Majesty's Secret Service";
            data[6]  = "Diamonds Are Forever";
            data[7]  = "Live And Let Die";
            data[8]  = "The Man With The Golden Gun";
            data[9]  = "The Spy Who Loved Me";
            data[10] = "Moonraker";
            data[11] = "For Your Eyes Only";
            data[12] = "Octopussy";
            data[13] = "Never Say Never Again";
            data[14] = "A View To A Kill";
            data[15] = "The Living Daylights";
            data[16] = "License To Kill";
            data[17] = "GoldenEye";
            data[18] = "Tomorrow Never Dies";
            data[19] = "The World Is Not Enough";
            data[20] = "Die Another Day";
            data[21] = "Casino Royale";
            data[22] = "Quantum of Solace";
            // skipped 23
            data[24] = "Extras";

            target["DataList"] = data;
            target.IsFieldMultiLine["DataList"] = true;

            string actual;

            actual = target.ToString();
            Assert.IsTrue(actual.Contains("The Man With The Golden Gun"));
        }
Пример #17
0
        public override Region CreateRegion(FormBase form)
        {
            Rectangle rect = new Rectangle(Point.Empty, form.Size);

            using (GraphicsPath path = GraphicsPathHelper.CreatePath(rect, form.Radius, form.RoundStyle, false))
            {
                return(new Region(path));
            }
        }
Пример #18
0
 public SkinFormControlBoxRenderEventArgs(Forms.FormBase form, Graphics graphics, Rectangle clipRect, bool active, ControlBoxStyle controlBoxStyle, ControlBoxState controlBoxState, CmSysButton cmSysbutton = null)
     : base(graphics, clipRect)
 {
     this._form            = form;
     this._active          = active;
     this._controlBoxState = controlBoxState;
     this._controlBoxStyle = controlBoxStyle;
     this._CmSysbutton     = cmSysbutton;
 }
Пример #19
0
        void InitSecurity()
        {
            bool _allowEdit = FormBase.CheckRule("admin_patients_abm");

            uc_Persona1.Enabled = _allowEdit;
            btnAdd.Enabled      = uc_MedioContacto1.Enabled = _allowEdit;
            aceptCancelButtonBar1.AceptButtonEnabled = _allowEdit;
            gridControl_MutualXPatient.Enabled       = _allowEdit;
            gridControl2.Enabled = _allowEdit;
        }
Пример #20
0
        /// <summary>
        /// 개시화면 리턴한다
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void POS_ST_M001_Unload(object sender, EventArgs e)
        {
            FormBase fb = (FormBase)sender;

            if (fb.DialogResult == DialogResult.Ignore)
            {
                this.Close();
                return;
            }
        }
Пример #21
0
        public ClassRegisters()
        {
            //register region --
            //FormBase.Register(c => new UserAccountService());



            //end register region --
            FormBase.RegisterComplex();
        }
Пример #22
0
 private void frmProfesionalCard_Load(object sender, EventArgs e)
 {
     if (this.DesignMode)
     {
         return;
     }
     uc_Profesionales_Card1.Populate(_IdProfesional, this.State);
     //uc_Profesionales_Card1.Refresh();
     aceptCancelButtonBar1.AceptButtonEnabled = FormBase.CheckRule("admin_professional_abm") || FormBase.CheckRule("admin_users_change_security") || FormBase.CheckRule("admin_professional_sheduling");
 }
Пример #23
0
 public void PerformBatchScan(BatchSettings settings, FormBase batchForm, Action<ScannedImage> imageCallback, Func<string, bool> progressCallback)
 {
     var state = new BatchState(scanPerformer, profileManager, fileNamePlaceholders, pdfExporter, operationFactory, pdfSettingsContainer, userConfigManager, formFactory)
     {
         Settings = settings,
         ProgressCallback = progressCallback,
         BatchForm = batchForm,
         LoadImageCallback = imageCallback
     };
     state.Do();
 }
        public async Task <IHttpActionResult> GetFormBase(int id)
        {
            FormBase formBase = await _dbContext.FormBases.FindAsync(id);

            if (formBase == null)
            {
                return(NotFound());
            }

            return(Ok(formBase));
        }
Пример #25
0
        public void ParseTest()
        {
            FormBase target   = new FormBase();
            string   spec     = TestSpec;
            bool     expected = true;         // TODO: Initialize to an appropriate value
            bool     actual;

            actual = target.Parse(spec);
            Assert.AreEqual(expected, actual);
            Assert.AreEqual("BondJamesBond", target["Name"]);
        }
        public async Task <IHttpActionResult> PostFormBase(FormBase formBase)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            _dbContext.FormBases.Add(formBase);
            await _dbContext.SaveChangesAsync();

            return(CreatedAtRoute("DefaultApi", new { id = formBase.Id }, formBase));
        }
Пример #27
0
 public async Task PerformBatchScan(BatchSettings settings, FormBase batchForm, Action <ScannedImage> imageCallback, Action <string> progressCallback, CancellationToken cancelToken)
 {
     var state = new BatchState(scanPerformer, profileManager, fileNamePlaceholders, pdfExporter, operationFactory, pdfSettingsContainer, ocrManager, formFactory)
     {
         Settings          = settings,
         ProgressCallback  = progressCallback,
         CancelToken       = cancelToken,
         BatchForm         = batchForm,
         LoadImageCallback = imageCallback
     };
     await state.Do();
 }
Пример #28
0
        public void PerformBatchScan(BatchSettings settings, FormBase batchForm, Action <ScannedImage> imageCallback, Func <string, bool> progressCallback)
        {
            var state = new BatchState(scanPerformer, profileManager, fileNamePlaceholders, pdfExporter, operationFactory, pdfSettingsContainer, ocrDependencyManager, formFactory)
            {
                Settings          = settings,
                ProgressCallback  = progressCallback,
                BatchForm         = batchForm,
                LoadImageCallback = imageCallback
            };

            state.Do();
        }
Пример #29
0
        public static void startupApplication()
        {
            //setup();

            //if (AppSettings.ClientOrServer == ClientOrServer.Client)
            {
#if DEBUG
                System.Threading.Thread.Sleep(1000);
#endif
                //MessageBox.Show("");

                setup.setupWindowsClient();

                //if (!Process.GetCurrentProcess().ProcessName.Contains("AppFrameworkBatchClient"))
                {
                    //Server.start();
                    Application.EnableVisualStyles();
                    Application.SetCompatibleTextRenderingDefault(false);
                    //AppSettings.EnableAlerts = false;
                    FormBase.show(typeof(Login), true);
                    if (Session.User != null)
                    {
                        MainForm mainForm = MainForm.getMainForm();
                        //mainForm.Load += mainForm_Load;
                        //mainForm.FormClosing += mainForm_FormClosing;
                        String endPoint = "";
                        try
                        {
                            endPoint = DatabaseHandler.DefaultDatabaseHandlerObject.Client.TcpClient.Client.RemoteEndPoint.ToString();
                        }
                        catch { }
                        mainForm.Text = String.Format("Premier [{0}] [{1}] [{2}]", Session.Username, endPoint, AppSettings.LicenseData.Item1);


                        //mainForm.Load += mainForm_Load;
                        setup.setupNavigationMenus();
                        Application.Run(mainForm);
                    }
                }
                //else
                //{
                //    //throw new Exception("Authentication Failure");
                //}
            }
            //else
            //{
            //    //setup();
            //    ////Infolog.add(Application.StartupPath, InfoType.Warning);
            //    //setupServer();
            //    bursarySetup.setupServer();
            //    Server.start();
            //}
        }
Пример #30
0
        /// <summary>
        ///
        /// </summary>
        private void AuthenticateUser()
        {
            //string wSiteName = Environment.GetEnvironmentVariable("USERDNSDOMAIN");
            String wDomainName = string.Empty;

            if (cmbDominios.Enabled)
            {
                wDomainName = cmbDominios.EditValue == null ? null : cmbDominios.EditValue.ToString();
            }

            ///FormBase.AuthenticateUser(txtUserName.Text, txtPassword.Text, _AuthenticationMode, wDomainName, _IsEnvironmentUser, wSiteName.ToString());
            FormBase.AuthenticateUser(txtUserName.Text, txtPassword.Text, _AuthenticationMode, wDomainName, _IsEnvironmentUser);
        }
Пример #31
0
        private void CameraButton_Click(object sender, EventArgs e)
        {
            _soundEngine.PlaySound(global::FNAF.Properties.Resources.VariousFNAFSound);
            Button button = (Button)sender;

            CharacterCollection characters = GetCharacters(button);

            FormBase form = GetForm(button);

            FormBase parent = GetParentForm();

            ThreadingEngine.GetThread <GameEngine>().UpdateForm(parent, form);
        }
Пример #32
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;
        }
Пример #33
0
 private void btnNew_Click(object sender, EventArgs e)
 {
     //fmMainUserControl f = new fmMainUserControl(UserId, UserName, WorkConst.STATE_ADD, "");
     //f.ShowDialog();
     FormBase dlg = new FormBase();
     UCmExcelTableTreeControl tc = new UCmExcelTableTreeControl();
     dlg.Text = "表单管理";
     dlg.WindowState = FormWindowState.Maximized;
     //dlg.MdiParent = MainHelper.MainForm;
     dlg.Controls.Add(tc);
     (tc).Dock = DockStyle.Fill;
     dlg.ShowDialog();
 }
Пример #34
0
 private void btReadMX_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     E_UserScore eu = gridView1.GetFocusedRow() as E_UserScore;
     if (eu!=null)
     {
         FormBase frm = new FormBase();
         frm.Height = 450;
         frm.Width = 650;
         frm.StartPosition = FormStartPosition.CenterScreen;
         UCE_UserScoreRecord uc = new UCE_UserScoreRecord();
         frm.Controls.Add(uc);
         uc.Dock = DockStyle.Fill;
         frm.Text = "查看分数明细";
         uc.UserID = eu.UserID;
         frm.ShowDialog();
     }
 }
Пример #35
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
            //    {


            //    }
            //}
        }
Пример #36
0
 /// <summary>
 /// 显示用户控件方法
 /// </summary>
 /// <param name="uc"></param>
 /// <returns></returns>
 private FormBase showControl(UserControl uc, string moduID, string text)
 {
     FormBase dlg = new FormBase();
     dlg.Text = text;
     dlg.Size = new Size(800, 600);
     dlg.StartPosition = FormStartPosition.CenterScreen;
     if (!string.IsNullOrEmpty(moduID))
     {
         Dictionary<string, object> dic = new Dictionary<string, object>();
         dic.Add("Modu_ID", moduID);
         dlg.Tag = dic;
     }
     dlg.Controls.Add(uc);
     uc.Dock = DockStyle.Fill;
     //dlg.ShowDialog();
     return dlg;
 }
Пример #37
0
        private FormBase form = null; //FormBase�ȼ�Ҫע���Ӧ��������

        #endregion Fields

        #region Constructors

        public MyMsgWindow(FormBase form)
        {
            this.form = form;
        }
Пример #38
0
 /// <summary>
 /// 显示用户控件方法
 /// </summary>
 /// <param name="uc"></param>
 /// <returns></returns>
 private FormBase showControl(UserControl uc, string moduID)
 {
     FormBase dlg = new FormBase();
     if (!string.IsNullOrEmpty(moduID))
     {
         Dictionary<string, object> dic = new Dictionary<string, object>();
         dic.Add("Modu_ID", moduID);
         dlg.Tag = dic;
     }
     dlg.MdiParent = this.ParentForm.ParentForm;
     dlg.Controls.Add(uc);
     uc.Dock = DockStyle.Fill;
     dlg.Show();
     return dlg;
 }
Пример #39
0
 public Connections(ConnectionCollection c, AccountCollection a, FormBase base_window)
 {
     this._ui_base = base_window;
     this._connectionCollection = c;
 }
Пример #40
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;
        }
Пример #41
0
        private void repositoryItemHyperLinkEdit1_Click(object sender, EventArgs e)
        {
            int ihand = gridTalskView.FocusedRowHandle;
            if (ihand < 0)
                return;
            DataRow dr = gridTalskView.GetDataRow(ihand);
            //mModule md = MainHelper.PlatformSqlMap.GetOneByKey<mModule>(dr["Modu_ID"]);
            //if (md != null)
            //{
            //    PlatForm.OpenModule(md);
            //}
            IList<WFP_RecordWorkTaskIns> rwt = MainHelper.PlatformSqlMap.GetList<WFP_RecordWorkTaskIns>("SelectWFP_RecordWorkTaskInsList", "where WorkFlowId='" + dr["WorkFlowId"] + "' and WorkFlowInsId='" + dr["WorkFlowInsId"] + "'");
            if (rwt.Count == 0) return;
            LP_Record currRecord= MainHelper.PlatformSqlMap.GetOneByKey<LP_Record>(rwt[0].RecordID);
            if (currRecord == null)
            {
                MainHelper.PlatformSqlMap.DeleteByWhere<WF_ModleRecordWorkTaskIns>(" where WorkFlowInsId='" + rwt[0].WorkFlowInsId + "'");
                MainHelper.PlatformSqlMap.DeleteByWhere<WF_OperatorInstance>(" where (WorkFlowInsId='" + rwt[0].WorkFlowInsId + "')");
                MainHelper.PlatformSqlMap.DeleteByWhere<WF_WorkTaskInstance>(" where (WorkFlowInsId='" + rwt[0].WorkFlowInsId + "')");
                MainHelper.PlatformSqlMap.DeleteByWhere<WF_WorkFlowInstance>(" where (WorkFlowInsId='" + rwt[0].WorkFlowInsId + "')");
                return;
            }
            DataTable dt = RecordWorkTask.GetRecordWorkFlowData(currRecord.ID, MainHelper.User.UserID);
            object obj = RecordWorkTask.GetWorkTaskModle(dr["WorkFlowId"].ToString(), dr["WorkTaskId"].ToString());
             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 = dr["FlowCaption"].ToString();
                 frm.RecordWorkFlowData = dt;
                 frm.ShowDialog();
                 refreshTreeData();
             }
             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 (dr["FlowCaption"].ToString().IndexOf("定期分析") > 0)
                                     yxfx.type = "定期分析";
                                 else
                                     if (dr["FlowCaption"].ToString().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;

                             }
                             ((frmyxfxWorkFlowEdit)obj).RowData = yxfx;

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

        }
Пример #42
0
 public NotificationManager(FormBase parentForm, AppConfigManager appConfigManager)
 {
     this.parentForm = parentForm;
     this.appConfigManager = appConfigManager;
     parentForm.Resize += parentForm_Resize;
 }
Пример #43
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;
        }
Пример #44
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;
        }
Пример #45
0
 /// <summary>
 /// 显示用户控件方法
 /// </summary>
 /// <param name="uc"></param>
 /// <returns></returns>
 private FormBase showControl(UserControl uc)
 {
     FormBase dlg = new FormBase();
     dlg.MdiParent = this;
     dlg.Controls.Add(uc);
     uc.Dock = DockStyle.Fill;
     dlg.Show();
     return dlg;
 }