/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void tsbModifyStatus_Click(object sender, EventArgs e) { bool b = App.Default.GetLoginOperatorRight().CanModifyFLStatus(this.FL.GetFLStatus()); if (!b) { NUnit.UiKit.UserMessage.DisplayFailure(Strings.CannotModifyMTStatus); return; } frmTMStatusModify f = new frmTMStatusModify(this.FL.GetFLStatus()); DialogResult dr = f.ShowDialog(); if (dr == DialogResult.OK) { FLStatus newStatus = f.NewMtStatus; this._newStatusList.Add(f.NewMtStatus); if (newStatus == FLStatus.Received) { Debug.Assert(this.FL.GetFLStatus() == FLStatus.Created); tblReceive rc = new tblReceive(); rc.rc_dt = DateTime.Now; rc.tblOperator = App.Default.LoginOperator; this.FL.tblReceive = rc; this.ucRc1.Rc = this.FL.tblReceive; SetReplyPageStyle(); FL.SetFLStatus(newStatus); } if (newStatus == FLStatus.Completed) { tblReply rp = new tblReply(); rp.tblOperator = App.Default.LoginOperator; this.FL.tblReply = rp; this.FL.SetFLStatus(newStatus); this.ucRp1.Reply = rp; } if (newStatus == FLStatus.Closed) { this.FL.SetFLStatus(newStatus); } this.RefreshFLStatusBar(); this.UpdateToolbarStyles(); this.UpdateModifyFlowStatusButtonStyle(); this.SelectLastTabPage(); } }
/// <summary> /// /// </summary> /// <param name="db"></param> /// <param name="tblReceive"></param> /// <returns></returns> internal tblReceive UpdateReceive(BxdbDataContext db, tblReceive tblReceive) { if (this.Rc == null) { return null; } if (tblReceive == null) { tblReceive = new tblReceive(); } tblReceive.rc_dt = this.dtpReceived.Value; tblReceive.tblOperator = db.tblOperator.First(c => c.op_id == App.Default.LoginOperator.op_id); if (tblReceive.rc_id == 0) { db.tblReceive.InsertOnSubmit(tblReceive); } return tblReceive; }