Added logic to prevent the selection of a procedure that is open by a different user
This commit is contained in:
parent
78d9affc00
commit
e609d8b974
@ -44,6 +44,7 @@ namespace VEPROMS
|
||||
this.btnCheck2 = new DevComponents.DotNetBar.ButtonX();
|
||||
this.ssMsg2 = new System.Windows.Forms.StatusStrip();
|
||||
this.tsslMsg2 = new System.Windows.Forms.ToolStripStatusLabel();
|
||||
this.tsslStatus = new System.Windows.Forms.ToolStripStatusLabel();
|
||||
this.btnApprove2 = new DevComponents.DotNetBar.ButtonX();
|
||||
this.btnCancel2 = new DevComponents.DotNetBar.ButtonX();
|
||||
this.labelX14 = new DevComponents.DotNetBar.LabelX();
|
||||
@ -66,7 +67,6 @@ namespace VEPROMS
|
||||
this.lblMore = new DevComponents.DotNetBar.LabelX();
|
||||
this.sttMore = new DevComponents.DotNetBar.SuperTooltip();
|
||||
this.pnlRogue = new System.Windows.Forms.Panel();
|
||||
this.tsslStatus = new System.Windows.Forms.ToolStripStatusLabel();
|
||||
((System.ComponentModel.ISupportInitialize)(this.approvalInfoBindingSource)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.stageInfoBindingSource)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.revTypeBindingSource)).BeginInit();
|
||||
@ -95,7 +95,6 @@ namespace VEPROMS
|
||||
//
|
||||
//
|
||||
//
|
||||
this.chkViewPDF.BackgroundStyle.Class = "";
|
||||
this.chkViewPDF.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
|
||||
this.chkViewPDF.DataBindings.Add(new System.Windows.Forms.Binding("Checked", this.approvalInfoBindingSource, "ViewPDF", true));
|
||||
this.chkViewPDF.Location = new System.Drawing.Point(279, 150);
|
||||
@ -150,7 +149,6 @@ namespace VEPROMS
|
||||
//
|
||||
//
|
||||
//
|
||||
this.chkSetAllDates.BackgroundStyle.Class = "";
|
||||
this.chkSetAllDates.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
|
||||
this.chkSetAllDates.Location = new System.Drawing.Point(11, 150);
|
||||
this.chkSetAllDates.Name = "chkSetAllDates";
|
||||
@ -190,8 +188,8 @@ namespace VEPROMS
|
||||
this.fgProcs.SelectionMode = C1.Win.C1FlexGrid.SelectionModeEnum.Cell;
|
||||
this.fgProcs.Size = new System.Drawing.Size(425, 341);
|
||||
this.fgProcs.TabIndex = 30;
|
||||
this.fgProcs.ComboCloseUp += new C1.Win.C1FlexGrid.RowColEventHandler(this.fgProcs_AfterEdit);
|
||||
this.fgProcs.AfterEdit += new C1.Win.C1FlexGrid.RowColEventHandler(this.fgProcs_AfterEdit);
|
||||
this.fgProcs.ComboCloseUp += new C1.Win.C1FlexGrid.RowColEventHandler(this.fgProcs_AfterEdit);
|
||||
//
|
||||
// approvalProcedureBindingSource
|
||||
//
|
||||
@ -202,7 +200,6 @@ namespace VEPROMS
|
||||
//
|
||||
//
|
||||
//
|
||||
this.chkCascade2.BackgroundStyle.Class = "";
|
||||
this.chkCascade2.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
|
||||
this.chkCascade2.Location = new System.Drawing.Point(147, 150);
|
||||
this.chkCascade2.Name = "chkCascade2";
|
||||
@ -241,6 +238,11 @@ namespace VEPROMS
|
||||
this.tsslMsg2.Name = "tsslMsg2";
|
||||
this.tsslMsg2.Size = new System.Drawing.Size(0, 17);
|
||||
//
|
||||
// tsslStatus
|
||||
//
|
||||
this.tsslStatus.Name = "tsslStatus";
|
||||
this.tsslStatus.Size = new System.Drawing.Size(0, 17);
|
||||
//
|
||||
// btnApprove2
|
||||
//
|
||||
this.btnApprove2.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
|
||||
@ -278,7 +280,6 @@ namespace VEPROMS
|
||||
//
|
||||
//
|
||||
//
|
||||
this.labelX14.BackgroundStyle.Class = "";
|
||||
this.labelX14.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
|
||||
this.labelX14.Location = new System.Drawing.Point(21, 64);
|
||||
this.labelX14.Name = "labelX14";
|
||||
@ -309,7 +310,6 @@ namespace VEPROMS
|
||||
//
|
||||
//
|
||||
//
|
||||
this.labelX16.BackgroundStyle.Class = "";
|
||||
this.labelX16.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
|
||||
this.labelX16.Location = new System.Drawing.Point(21, 38);
|
||||
this.labelX16.Name = "labelX16";
|
||||
@ -361,7 +361,6 @@ namespace VEPROMS
|
||||
//
|
||||
//
|
||||
//
|
||||
this.labelX17.BackgroundStyle.Class = "";
|
||||
this.labelX17.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
|
||||
this.labelX17.Location = new System.Drawing.Point(21, 12);
|
||||
this.labelX17.Name = "labelX17";
|
||||
@ -395,7 +394,6 @@ namespace VEPROMS
|
||||
//
|
||||
//
|
||||
//
|
||||
this.lblPhase.BackgroundStyle.Class = "";
|
||||
this.lblPhase.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
|
||||
this.lblPhase.Font = new System.Drawing.Font("Microsoft Sans Serif", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.lblPhase.Location = new System.Drawing.Point(300, 20);
|
||||
@ -410,7 +408,6 @@ namespace VEPROMS
|
||||
//
|
||||
//
|
||||
//
|
||||
this.chkCascadeMore.BackgroundStyle.Class = "";
|
||||
this.chkCascadeMore.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
|
||||
this.chkCascadeMore.Location = new System.Drawing.Point(131, 510);
|
||||
this.chkCascadeMore.Name = "chkCascadeMore";
|
||||
@ -516,7 +513,7 @@ namespace VEPROMS
|
||||
this.btnOkay.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnOkay.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
|
||||
this.btnOkay.TabIndex = 14;
|
||||
this.btnOkay.Text = "OK";//Fixed Code Change Request C2015-056
|
||||
this.btnOkay.Text = "OK";
|
||||
this.btnOkay.Click += new System.EventHandler(this.btnOkay_Click);
|
||||
//
|
||||
// btnCancelMore
|
||||
@ -541,7 +538,6 @@ namespace VEPROMS
|
||||
//
|
||||
//
|
||||
//
|
||||
this.lblMore.BackgroundStyle.Class = "";
|
||||
this.lblMore.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
|
||||
this.lblMore.Location = new System.Drawing.Point(15, 12);
|
||||
this.lblMore.Name = "lblMore";
|
||||
@ -552,6 +548,7 @@ namespace VEPROMS
|
||||
// sttMore
|
||||
//
|
||||
this.sttMore.CheckTooltipPosition = false;
|
||||
this.sttMore.DefaultTooltipSettings = new DevComponents.DotNetBar.SuperTooltipInfo("", "", "", null, null, DevComponents.DotNetBar.eTooltipColor.Gray);
|
||||
this.sttMore.LicenseKey = "F962CEC7-CD8F-4911-A9E9-CAB39962FC1F";
|
||||
this.sttMore.PositionBelowControl = false;
|
||||
//
|
||||
@ -563,11 +560,6 @@ namespace VEPROMS
|
||||
this.pnlRogue.Size = new System.Drawing.Size(72, 574);
|
||||
this.pnlRogue.TabIndex = 25;
|
||||
//
|
||||
// tsslStatus
|
||||
//
|
||||
this.tsslStatus.Name = "tsslStatus";
|
||||
this.tsslStatus.Size = new System.Drawing.Size(0, 17);
|
||||
//
|
||||
// dlgApproveProcedure
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
|
@ -182,7 +182,14 @@ namespace VEPROMS
|
||||
{
|
||||
foreach (ProcedureInfo pi in _MyDocVersion.Procedures)
|
||||
{
|
||||
OwnerInfo oi = OwnerInfo.GetByItemID(pi.ItemID, CheckOutType.Procedure);
|
||||
pi.MyDocVersion.DocVersionConfig.SelectedSlave = _MyDocVersion.DocVersionConfig.SelectedSlave;
|
||||
if (oi != null && oi.SessionID != MySessionInfo.SessionID)
|
||||
{
|
||||
string prcNumber = pi.DisplayNumber + string.Format(" Checked out to {0}", oi.SessionUserID);
|
||||
clbMore.Items.Add(prcNumber);
|
||||
}
|
||||
else
|
||||
clbMore.Items.Add(pi.DisplayNumber);
|
||||
tmpProcedures.Add(pi.DisplayNumber, pi);
|
||||
}
|
||||
@ -200,6 +207,8 @@ namespace VEPROMS
|
||||
private Dictionary<string, ProcedureInfo> tmpProcedures = new Dictionary<string, ProcedureInfo>();
|
||||
private ProcedureInfo GetProcedureInfoByKey(string key)
|
||||
{
|
||||
if (key.Contains(" Checked out to "))
|
||||
key = key.Substring(0, key.IndexOf(" Checked out to "));
|
||||
if (tmpProcedures.ContainsKey(key))
|
||||
return tmpProcedures[key];
|
||||
else
|
||||
@ -300,6 +309,15 @@ namespace VEPROMS
|
||||
}
|
||||
private void clbMore_ItemCheck(object sender, ItemCheckEventArgs e)
|
||||
{
|
||||
ProcedureInfo pi = GetProcedureInfoByKey(clbMore.Items[e.Index].ToString());
|
||||
OwnerInfo oi = OwnerInfo.GetByItemID(pi.ItemID, CheckOutType.Procedure);
|
||||
if (oi != null && oi.SessionID != MySessionInfo.SessionID)
|
||||
{
|
||||
string msg = string.Format("Cannot select this procedure for approval.\n\n It is checked out to {0}", oi.SessionUserID);
|
||||
MessageBox.Show(msg,pi.DisplayNumber);
|
||||
e.NewValue = CheckState.Unchecked;
|
||||
return;
|
||||
}
|
||||
if (e.NewValue == CheckState.Checked)
|
||||
btnOkay.Enabled = true;
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user