private void tlbbSave_Click(object sender, C1.Win.C1Command.ClickEventArgs e) { if (IsValidPCI() == true) { LoadScreenToObject(); moPci.Save(); tlbbSave.Enabled = false; if (mbNewPCNNeeded == true) { string msg = "Do you wish to create a PCN for this PCI?"; if (MessageBox.Show(msg, "New PCN", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes) { CBPCIInfo.CreatePCNFromPCI(moPci.ProjectID, moPci.ID); } } if (OnPCIChanged != null) { OnPCIChanged(moPci.ID, "Saved"); } } }
private void tlbbLockUnlock_Click(object sender, C1.Win.C1Command.ClickEventArgs e) { if (tlbbLockUnlock.Text == "Locked") { tlbbLockUnlock.Text = "Unlocked"; moPci.IsLocked = false; CBPCIInfo.SetLockOnPCI(moPci.ID, false); SetLockedState(true); } else { if (tlbbSave.Enabled == true) { MessageBox.Show("Please save PCI before locking", "Unsaved", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { tlbbLockUnlock.Text = "Locked"; moPci.IsLocked = true; CBPCIInfo.SetLockOnPCI(moPci.ID, true); SetLockedState(false); } } }
public void SetPCI(int pciID) { moPci = new CBPCIInfo(); moPci.Load(pciID); LoadObjectToScreen(); tlbbSave.Enabled = false; }
private void tdbgPCILog_AfterColEdit(object sender, C1.Win.C1TrueDBGrid.ColEventArgs e) { int bm = tdbgPCILog.Bookmark; if (bm >= 0) { int pciID = Convert.ToInt32(mdsPCILogs.Tables[0].Rows[bm]["ID"]); string comm; comm = mdsPCILogs.Tables[0].Rows[bm]["Comments"].ToString(); CBPCIInfo.SetPCIComments(pciID, comm); } }
public void PreviewPCI(int pciID) { FPreviewAR pv = new FPreviewAR(); rprtPCIInformation rprt = new rprtPCIInformation(); CBPCIInfo info = new CBPCIInfo(); info.Load(pciID); rprt.SetInformation(info); pv.ViewReport(rprt); pv.ShowDialog(); }
private void LoadPCILog(int projID) { CBProject proj = new CBProject(); CBCustomer cust = new CBCustomer(); CBEmployee emp = new CBEmployee(); CBPCIInfo pci = new CBPCIInfo(); miProjectID = projID; proj.Load(projID); cust.Load(proj.CustomerID); emp.Load(proj.ProjMngrID); emp.Load(proj.LeadProjMngrID); txtClient.Text = cust.Name; txtProjName.Text = proj.Description; txtHGANumber.Text = proj.Number; txtClientNumber.Text = proj.CustomerProjNumber; txtProjectManager.Text = emp.Name; mdsPCILogs = CBPCIInfo.GetPCILogByProjID(projID); tdbgPCILog.SetDataBinding(mdsPCILogs, "Table", true); int hours; decimal tic; hours = 0; tic = 0; CBPCIInfo.GetPCILogTotalByProjID(projID, ref hours, ref tic); txtTotalEngHrs.Text = hours.ToString(); txtTotalEngrTIC.Text = tic.ToString("#,##0"); if (mdsPCILogs.Tables[0].Rows.Count > 0) { tlbbPrint.Enabled = true; } else { tlbbPrint.Enabled = false; } }
private void LoadPCIList() { SqlDataReader dr; ListViewItem lvi; bool proceed; bool track; bool notAppv; if (miDeptID <= 0) { dr = CBPCIInfo.GetListByProjAllDepts(miProjID); } else { dr = CBPCIInfo.GetListByProjDept(miProjID, miDeptID); } lvwPCIs.Items.Clear(); while (dr.Read()) { lvi = new ListViewItem(); lvi.Text = dr["ID"].ToString(); lvi.SubItems.Add(dr["PCINumber"].ToString()); lvi.SubItems.Add(dr["Department"].ToString()); lvi.SubItems.Add(dr["PCITitle"].ToString()); proceed = Convert.ToBoolean(dr["ApprovedProceed"]); track = Convert.ToBoolean(dr["ApprovedTrack"]); notAppv = Convert.ToBoolean(dr["ApprovedNot"]); lvi.SubItems.Add(GetStatus(proceed, track, notAppv)); lvwPCIs.Items.Add(lvi); } dr.Close(); bttOpen.Enabled = false; }
public void PreviewPCI_New(string projNumber, int pciID) // *************************** Added 6/25/15 { FPreviewAR pv = new FPreviewAR(); rprtPCIInformation rprt = new rprtPCIInformation(); CBPCIInfo info = new CBPCIInfo(); //CBBudget bud = new CBBudget(); //CBProject proj = new CBProject(); //bud.Load(budID); //proj.Load(bud.ProjectID); info.Load(pciID); rprt.SetInformation(info); pv.projNumber = projNumber; // MessageBox.Show(pv.projNumber); pv.ViewReport(rprt); pv.ShowDialog(); }
public void ClearForm(bool forceClear) { if (moPci != null && forceClear == false) { return; } moPci = new CBPCIInfo(); txtDiscipline.Text = ""; lblPCINumber.Text = CBPCIInfo.GetNextPCINumber(miDiscipline, miProject); txtInitiatedBy.Text = ""; lblProjectNumber.Text = ""; lblProjectTitle.Text = ""; txtPCITitle.Text = ""; dtpDateInitiated.Value = DateTime.Now; txtRequestedBy.Text = ""; dtpDateRequested.Value = DateTime.Now; txtDescription.Text = ""; rdoDesignError.Checked = false; rdoVendorError.Checked = false; rdoEstimatingError.Checked = false; rdoContractorError.Checked = false; rdoScheduleDelay.Checked = false; rdoScopeAddition.Checked = false; rdoScopeDeletion.Checked = false; rdoDesignChange.Checked = false; rdoOther.Checked = false; txtOtherReason.Text = ""; txtOtherReason.Enabled = false; chkMechPiping.Checked = false; chkCSA.Checked = false; chkProjAdmin.Checked = false; chkProcess.Checked = false; chkElectInst.Checked = false; txtEstimatedHrs.Text = ""; txtEstimatedCost.Text = ""; txtEstimatedTIC.Text = ""; txtEstimatedAccuracy.Text = ""; txtScheduleImpact.Text = ""; chkAppvProceed.Checked = false; chkAppvTrack.Checked = false; chkNotAppvDNP.Checked = false; txtProjMngr.Text = ""; lblDateApproved.Text = ""; if (miDiscipline != 0) { CBDepartment dept = new CBDepartment(); dept.Load(miDiscipline); txtDiscipline.Text = dept.Name; moPci.DepartmentID = miDiscipline; } if (miProject != 0) { CBProject proj = new CBProject(); CBEmployee emp = new CBEmployee(); proj.Load(miProject); emp.Load(proj.ProjMngrID); emp.Load(proj.LeadProjMngrID); lblProjectNumber.Text = proj.Number; lblProjectTitle.Text = proj.Description; txtProjMngr.Text = emp.Name; moPci.ProjectID = miProject; moPci.ProjectManagerID = proj.ProjMngrID; } mbNewPCNNeeded = false; }