private void RibbonIFS_Load(object sender, RibbonUIEventArgs e)
        {
            try
            {
                myJiraLync = new JiraLync();

                myCustomTaskPane = Globals.ThisAddIn.CustomTaskPanes.Add(new DefaultValueManager(), "JIRA Tools Default Values");
                myCustomTaskPane.DockPositionRestrict = Microsoft.Office.Core.MsoCTPDockPositionRestrict.msoCTPDockPositionRestrictNoHorizontal;
            }
            catch (Exception)
            {
            }

            try
            {
                mySave = new FormSave();
                if (myJiraLync != null)
                {
                    mySave.MyJiraLync = this.myJiraLync;
                }

                editBoxServerURL.Text = Properties.Settings.Default.JiraServer;
                editBoxReporter.Text  = Properties.Settings.Default.UserName;
                editBoxPassword.Text  = Properties.Settings.Default.Password;

                editBoxProjectId.Text    = Properties.Settings.Default.JiraProjectID;
                editBoxTeam.Text         = Properties.Settings.Default.Component_Team;
                editBoxFixIteration.Text = Properties.Settings.Default.FixVersion;
                editBoxAssignee.Text     = Properties.Settings.Default.Assignee;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Loading Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
 public virtual void DoAdd()
 {
     FormSave.LoadModel(null);
     if (FormSave.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         DoRefresh();
     }
 }
 public virtual void DoEdit()
 {
     if (RowModel != null)
     {
         FormSave.LoadModel(RowModel);
         if (FormSave.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             DoRefresh();
         }
     }
 }
        protected void Button1_Click(object sender, EventArgs e)
        {
            int ret = FormSave.SetID();

            if (ret > 0)
            {
                this.Label1.Text      = "成功!共" + ret.ToString() + "条语句";
                this.Label1.ForeColor = System.Drawing.Color.Blue;
            }
            else
            {
                this.Label1.Text      = "失败";
                this.Label1.ForeColor = System.Drawing.Color.Red;
            }
        }
        public void saveData(FormSave formSave, Table table, Boolean status)
        {
            isSaveData                                = true;
            isReadData                                = false;
            this.formSave                             = formSave;
            backgroudWoker                            = new BackgroundWorker();
            backgroudWoker.DoWork                    += new DoWorkEventHandler(readRecordsDoWork);
            backgroudWoker.RunWorkerCompleted        += new RunWorkerCompletedEventHandler(saveRunWorkerCompletedEventHandler);
            backgroudWoker.WorkerSupportsCancellation = true;

            var tableData = new Tuple <Table, Boolean>(table, status);

            backgroudWoker.RunWorkerAsync(tableData);
            formWait              = new FormWait();
            formWait.FormClosing += new FormClosingEventHandler(waitFormClosingEventHandler);
            formWait.ShowDialog();
        }
示例#6
0
        private void сохранитьToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FormSave formSave = new FormSave();

            formSave.ShowDialog();
        }
        protected void btnSecFF_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.txtProcessID.Text == string.Empty)
                {
                    JScript.Alert("只有已经启动的流程才能二次分发!");
                    return;
                }
                List <EntityBase> bworkitems = B_FormsData.GetEntities(this.txtProcessID.Text, "", ProcessConstString.TemplateName.LETTER_RECEIVE, "", true);
                B_LetterReceive   NewEntity  = new B_LetterReceive();
                B_LetterReceive   bworkitem  = bworkitems != null && bworkitems.Count > 0 ? bworkitems[0] as B_LetterReceive : new B_LetterReceive();

                NewEntity.ProcessID = this.txtProcessID.Text;

                NewEntity.WorkItemID = Guid.NewGuid().ToString("N");
                bworkitem.WorkItemID = NewEntity.WorkItemID;

                bworkitem.StepName = ProcessConstString.SubmitAction.LetterReceiveAction.ACTION_FF2;
                NewEntity.StepName = ProcessConstString.SubmitAction.LetterReceiveAction.ACTION_FF2;

                bworkitem.SubmitDate = System.DateTime.Now;
                NewEntity.SubmitDate = System.DateTime.Now;

                bworkitem.CommentList.Clear();

                bworkitem.UrgentDegree = this.ddlUrgentDegree.SelectedValue;
                NewEntity.UrgentDegree = this.ddlUrgentDegree.SelectedValue;

                bworkitem.DocumentNo = this.txtDocumentNo.Text;
                NewEntity.DocumentNo = this.txtDocumentNo.Text;

                bworkitem.ReceiptDate = this.txtReceiveDate.Text != string.Empty ? DateTime.Parse(this.txtReceiveDate.Text) : DateTime.MinValue;
                NewEntity.ReceiptDate = this.txtReceiveDate.Text != string.Empty ? DateTime.Parse(this.txtReceiveDate.Text) : DateTime.MinValue;

                bworkitem.FileEncoding = this.txtDocumentEncoding.Text;
                NewEntity.FileEncoding = this.txtDocumentEncoding.Text;

                bworkitem.CommunicationUnit = this.txtReceiveUnit.Text;
                NewEntity.CommunicationUnit = this.txtReceiveUnit.Text;

                bworkitem.DocumentTitle = this.txtDocumentTitle.Text;
                NewEntity.DocumentTitle = this.txtDocumentTitle.Text;

                bworkitem.Remarks = this.txtRemark.Text;
                NewEntity.Remarks = this.txtRemark.Text;

                bworkitem.FileList = this.ucAttachment.UCDataList;
                NewEntity.FileList = this.ucAttachment.UCDataList;

                bworkitem.ReceiveDateTime = DateTime.Now;
                NewEntity.ReceiveDateTime = DateTime.Now;

                bworkitem.ReceiveUserID = CurrentUserInfo.UserName;
                NewEntity.ReceiveUserID = CurrentUserInfo.UserName;

                bworkitem.ReceiveUserName   = CurrentUserInfo.DisplayName;
                NewEntity.ReceiveUserName   = CurrentUserInfo.DisplayName;
                NewEntity.D_StepStatus      = bworkitem.D_StepStatus;
                NewEntity.ReceiptDate       = bworkitem.ReceiptDate;
                NewEntity.Pages             = bworkitem.Pages;
                NewEntity.ChuanYueLeader    = bworkitem.ChuanYueLeader;
                NewEntity.AssistDept        = bworkitem.AssistDept;
                NewEntity.AssistDeptName    = bworkitem.AssistDeptName;
                NewEntity.ChuanYueLeader    = bworkitem.ChuanYueLeader;
                NewEntity.ChuanYueDept      = bworkitem.ChuanYueDept;
                NewEntity.LeaderShip        = bworkitem.LeaderShip;
                NewEntity.LeaderShipName    = bworkitem.LeaderShipName;
                NewEntity.LS_Comment        = bworkitem.LS_Comment;
                NewEntity.UnderTakeID       = bworkitem.UnderTakeID;
                NewEntity.UnderTake         = bworkitem.UnderTake;
                NewEntity.UnderTake_Comment = bworkitem.UnderTake_Comment;
                NewEntity.UnderTakeLeaders  = bworkitem.UnderTakeLeaders;
                NewEntity.NiBanRen          = bworkitem.NiBanRen;
                NewEntity.NiBanRenName      = bworkitem.NiBanRenName;
                NewEntity.NiBanComment      = bworkitem.NiBanComment;
                NewEntity.Drafter           = bworkitem.Drafter;
                NewEntity.DraftDate         = bworkitem.DraftDate;
                NewEntity.RegisterID        = bworkitem.RegisterID;
                NewEntity.Prompt            = bworkitem.Prompt;
                NewEntity.ChuanYueDeptID    = bworkitem.ChuanYueDeptID;
                NewEntity.HJPrompt          = bworkitem.HJPrompt;
                NewEntity.ChuanYueLeaderID  = bworkitem.ChuanYueLeaderID;
                NewEntity.AgentUserName     = bworkitem.AgentUserName;
                NewEntity.AgentUserID       = bworkitem.AgentUserID;

                NewEntity.FormsData = XmlUtility.SerializeXml(bworkitem as EntityBase);
                FormSave.SaveEntity(NewEntity, false);

                if (B_ProcessInstance.IsCompletedOrCancel(NewEntity.ProcessID))
                {
                    B_ProcessInstance.MoveToBakTable(NewEntity.WorkItemID, "T_OA_HS_WorkItems", "T_OA_HS_WorkItems_BAK"); //在备份库中插入数据
                    B_ProcessInstance.UpdateRecordStatus(NewEntity.WorkItemID, 2);                                        //将现行库数据更新为不可用。
                }

                btnModify_Click(null, null);

                //string filedata = "<FileList />";
                //if (this.ucAttachment.UCDataList.Count > 0)
                //{
                //    string formdata = XmlUtility.SerializeXml<B_LetterReceive>(bworkitem);
                //    int iStartIndex = formdata.IndexOf("<FileList>");
                //    int iEndIndex = formdata.IndexOf("</FileList>");
                //    if (iEndIndex > iStartIndex)
                //    {
                //        filedata = formdata.Substring(iStartIndex, iEndIndex - iStartIndex);
                //        filedata += "</FileList>";
                //    }
                //}
                //FormsMethod.UpdateAssignFileData(bworkitem.ProcessID,ProcessConstString.TemplateName.LETTER_RECEIVE, "", filedata);
                List <EntityBase> bworkitemsAssign = B_FormsData.GetEntities(this.txtProcessID.Text, "", ProcessConstString.TemplateName.LETTER_RECEIVE, "", true, "'New','Assigned'");
                string            strUpdatePeople  = string.Empty;
                foreach (EntityBase entity in bworkitemsAssign)
                {
                    B_LetterReceive lentity = entity as B_LetterReceive;

                    lentity.SubmitDate = System.DateTime.Now;

                    lentity.UrgentDegree = this.ddlUrgentDegree.SelectedValue;

                    lentity.DocumentNo = this.txtDocumentNo.Text;

                    lentity.ReceiptDate  = this.txtReceiveDate.Text != string.Empty ? DateTime.Parse(this.txtReceiveDate.Text) : DateTime.MinValue;
                    lentity.FileEncoding = this.txtDocumentEncoding.Text;

                    lentity.CommunicationUnit = this.txtReceiveUnit.Text;

                    lentity.DocumentTitle = this.txtDocumentTitle.Text;

                    lentity.Remarks = this.txtRemark.Text;

                    lentity.FileList = this.ucAttachment.UCDataList;
                    FormSave.SaveEntity(lentity as EntityBase, true);
                    strUpdatePeople += lentity.ReceiveUserName + ",";
                }
                B_ToCirculate l_busCirculate = new B_ToCirculate();
                l_busCirculate.IsAgain       = true;
                l_busCirculate.ToProcessType = ProcessConstString.TemplateName.LETTER_RECEIVE;
                l_busCirculate.ToProcessID   = bworkitem.ProcessID;
                l_busCirculate.ToWorkItemID  = bworkitem.WorkItemID;
                l_busCirculate.ToUserIDS     = B_FormsData.GetProcessPeople("'Completed','Removed'", this.txtProcessID.Text, ";", true);
                string strInfo = string.Empty;
                if (l_busCirculate.ToUserIDS != string.Empty)
                {
                    strInfo = l_busCirculate.ChuanYueToDB();
                }
                strUpdatePeople = strUpdatePeople.Length > 0?strUpdatePeople.Substring(0, strUpdatePeople.Length - 1):"";
                strInfo         = strInfo.Replace("传阅成功", "二次分发成功");
                strInfo        += string.IsNullOrEmpty(strInfo) ? "" : "\\n";
                strInfo        += string.IsNullOrEmpty(strUpdatePeople) ? "" : ("(" + strUpdatePeople + ")更新成功!");
                if (strInfo != string.Empty)
                {
                    JScript.Alert(strInfo);
                }
                else
                {
                    JScript.Alert("二次分发成功!无人员传阅和数据更新!");
                }
            }
            catch
            {
                JScript.Alert("二次分发失败!");
            }
        }