private void LoadActivityCodes() { RSLib.COListItem li; SqlDataReader dr; cboActivityCodes.Items.Clear(); dr = CBActivityCode.GetList(); li = new RSLib.COListItem(); li.ID = 0; li.Description = ""; cboActivityCodes.Items.Add(li); while (dr.Read()) { li = new RSLib.COListItem(); li.ID = Convert.ToInt32(dr["ID"]); li.Description = dr["Code"].ToString(); cboActivityCodes.Items.Add(li); } dr.Close(); }
private int LoadScreenToObject_X(int indx, int deptID, int projID, int leadID, Excel._Worksheet WS) { moDrwLog = new CBDrawingLog(); //if (WS.Cells[indx, 1].Text == "") // moDrwLog.ID = 0; //else // moDrwLog.ID = Convert.ToInt32(WS.Cells[indx, 1].Value.ToString()); moDrwLog.ID = Convert.ToInt32(WS.Cells[indx, "A"].Value); // MessageBox.Show(moDrwLog.ID.ToString()); moDrwLog.DepartmentID = deptID; moDrwLog.ProjectID = projID; moDrwLog.ProjectLeadID = leadID; // ******* Added 11/30 moDrwLog.WBS = WS.Cells[indx, 5].Text; moDrwLog.HGANumber = WS.Cells[indx, 6].Text; moDrwLog.ClientNumber = WS.Cells[indx, 7].Text; moDrwLog.CADNumber = WS.Cells[indx, 8].Text; // moDrwLog.ActCodeID = Array.IndexOf(AccountCodeID, Convert.ToInt32(WS.Cells[indx, 9].Value)); ///****************11/20 moDrwLog.ActCodeID = CBActivityCode.GetID_ByActivityCode(Convert.ToInt32(WS.Cells[indx, 9].Value)); /// ************************** to fetch index of AccountCode ***11/23 // MessageBox.Show("From Sheet....."+WS.Cells[indx, 9].Value + ".....ID...." + moDrwLog.ActCodeID); //moDrwLog.IsTask = chkIsTask.Checked; moDrwLog.IsTaskDrwgSpec = Convert.ToInt32(WS.Cells[indx, 10].Value); // moDrwLog.DrawingSizeID = GetDrawingSizeCode(); moDrwLog.DrawingSizeID = Convert.ToInt32(WS.Cells[indx, 11].Value); try { moDrwLog.BudgetHrs = Convert.ToDecimal(WS.Cells[indx, 12].Text); } catch { moDrwLog.BudgetHrs = 0; } try { moDrwLog.PercentComplete = Convert.ToDecimal(WS.Cells[indx, 13].Text); } catch { moDrwLog.PercentComplete = 0; } try { moDrwLog.RemainingHrs = Convert.ToDecimal(WS.Cells[indx, 14].Text); } catch { moDrwLog.RemainingHrs = 0; } try { moDrwLog.EarnedHrs = Convert.ToDecimal(WS.Cells[indx, 15].Text); } catch { moDrwLog.EarnedHrs = 0; } moDrwLog.Title1 = WS.Cells[indx, 16].Text; moDrwLog.Title2 = WS.Cells[indx, 19].Text; moDrwLog.Title3 = WS.Cells[indx, 22].Text; moDrwLog.Title4 = WS.Cells[indx, 25].Text; moDrwLog.Title5 = WS.Cells[indx, 28].Text; moDrwLog.Title6 = WS.Cells[indx, 31].Text; bool IsTitle1, IsTitle2, IsTitle3, IsTitle4, IsTitle5, IsTitle6; bool IsDesc1, IsDesc2, IsDesc3, IsDesc4, IsDesc5, IsDesc6; if (WS.Cells[indx, 17].Value.ToString() == "True") { IsTitle1 = true; } else { IsTitle1 = false; } if (WS.Cells[indx, 20].Value.ToString() == "True") { IsTitle2 = true; } else { IsTitle2 = false; } if (WS.Cells[indx, 23].Value.ToString() == "True") { IsTitle3 = true; } else { IsTitle3 = false; } if (WS.Cells[indx, 26].Value.ToString() == "True") { IsTitle4 = true; } else { IsTitle4 = false; } if (WS.Cells[indx, 29].Value.ToString() == "True") { IsTitle5 = true; } else { IsTitle5 = false; } if (WS.Cells[indx, 32].Value.ToString() == "True") { IsTitle6 = true; } else { IsTitle6 = false; } if (WS.Cells[indx, 18].Value.ToString() == "True") { IsDesc1 = true; } else { IsDesc1 = false; } if (WS.Cells[indx, 21].Value.ToString() == "True") { IsDesc2 = true; } else { IsDesc2 = false; } if (WS.Cells[indx, 24].Value.ToString() == "True") { IsDesc3 = true; } else { IsDesc3 = false; } if (WS.Cells[indx, 27].Value.ToString() == "True") { IsDesc4 = true; } else { IsDesc4 = false; } if (WS.Cells[indx, 30].Value.ToString() == "True") { IsDesc5 = true; } else { IsDesc5 = false; } if (WS.Cells[indx, 33].Value.ToString() == "True") { IsDesc6 = true; } else { IsDesc6 = false; } moDrwLog.Title1IsTitle = IsTitle1; moDrwLog.Title2IsTitle = IsTitle2; moDrwLog.Title3IsTitle = IsTitle3; moDrwLog.Title4IsTitle = IsTitle4; moDrwLog.Title5IsTitle = IsTitle5; moDrwLog.Title6IsTitle = IsTitle6; moDrwLog.Title1IsDesc = IsDesc1; moDrwLog.Title2IsDesc = IsDesc2; moDrwLog.Title3IsDesc = IsDesc3; moDrwLog.Title4IsDesc = IsDesc4; moDrwLog.Title5IsDesc = IsDesc5; moDrwLog.Title6IsDesc = IsDesc6; moDrwLog.Revision = WS.Cells[indx, 34].Text; moDrwLog.ReleasedDrawingID = Convert.ToInt32(WS.Cells[indx, 35].Value); //if (dtpDateRevised.Checked == false) moDrwLog.DateRevised = RSLib.COUtility.DEFAULTDATE; //else //moDrwLog.DateRevised = dtpDateRevised.Value; // if (dtpDateDue.Checked == false) moDrwLog.DateDue = RSLib.COUtility.DEFAULTDATE; //else // moDrwLog.DateDue = dtpDateDue.Value; //if (dtpDateLate.Checked == false) moDrwLog.DateLate = RSLib.COUtility.DEFAULTDATE; // else // moDrwLog.DateLate = dtpDateLate.Value; return(moDrwLog.ID); }
public void ClearForm() { moPCN = new CBBudgetPCN(); moPCN.Clear(); txtInitiatedBy.Text = ""; lblProjectNumber.Text = ""; lblProjectTitle.Text = ""; txtPCNTitle.Text = ""; dtpDateInitiated.Value = DateTime.Now; txtRequestedBy.Text = ""; dtpDateRequested.Value = DateTime.Now; txtDescription.Text = ""; chkDesignError.Checked = false; chkVendorError.Checked = false; chkEstimatingError.Checked = false; chkContractorError.Checked = false; chkScheduleDelay.Checked = false; chkScopeAdd.Checked = false; chkScopeDel.Checked = false; chkDesignChange.Checked = false; chkOther.Checked = false; txtOtherReason.Text = ""; txtOtherReason.Enabled = false; txtEstimatedHrs.Text = ""; txtEstimatedDollars.Text = ""; txtEstimTIC.Text = ""; txtEstimateAccuracy.Text = ""; txtScheduleImpact.Text = ""; chkApproved.Checked = false; chkDisapproved.Checked = false; chkPrepareControlEstimate.Checked = false; txtProjMngr.Text = ""; lblDateApproved.Text = ""; txtPCNNumber.Text = ""; tdbgHours.SetDataBinding(moPCN.PCNData, "PCNHours", true); tdbgExpenses.SetDataBinding(moPCN.PCNData, "PCNExpenses", true); SqlDataReader dr = CBActivityCode.GetListForBudget(); DataRow d; mdsAccnts = new dsAccts(); mdsExpensAccts = new dsAccts(); mdsDeptGroup = new dsAccts(); while (dr.Read()) { d = mdsAccnts.Tables["Accounts"].NewRow(); d["Code"] = dr["Code"]; d["Description"] = dr["Description"]; mdsAccnts.Tables["Accounts"].Rows.Add(d); } dr.Close(); tdbdActivities.SetDataBinding(mdsAccnts, "Accounts", true); dr = CBProjectBudget.GetExpenseGroupByDiscipline(0); while (dr.Read()) { d = mdsExpensAccts.Tables["Accounts"].NewRow(); d["Code"] = dr["Code"]; d["Description"] = dr["Description"]; d["DefaultMU"] = dr["DefaultMU"]; mdsExpensAccts.Tables["Accounts"].Rows.Add(d); } dr.Close(); tdbdExpenseAccts.SetDataBinding(mdsExpensAccts, "Accounts", true); dr = CBActivityCode.GetDeptGroup(); while (dr.Read()) { d = mdsDeptGroup.Tables["Accounts"].NewRow(); d["Code"] = dr["Code"]; d["Description"] = dr["Description"]; //d["DefaultMU"] = dr["DefaultMU"]; mdsDeptGroup.Tables["Accounts"].Rows.Add(d); } dr.Close(); tdbdDeptGroup.SetDataBinding(mdsDeptGroup, "Accounts", true); }
private void LoadObjectToScreen() { CBActivityCode ac; CBDrawingSize ds; CBReleaseDrawing rd; txtHGANumber.Text = moDrwLog.HGANumber; txtClientNumber.Text = moDrwLog.ClientNumber; txtCADNumber.Text = moDrwLog.CADNumber; ac = new CBActivityCode(); ac.Load(moDrwLog.ActCodeID); cboActivityCodes.Text = ac.Code; if (moDrwLog.DepartmentID == 10) { SetDrawingType(1); } else { SetDrawingType(moDrwLog.IsTaskDrwgSpec); } ds = new CBDrawingSize(); ds.Load(moDrwLog.DrawingSizeID); cboDrawingSizes.Text = ds.Size; txtWBS.Text = moDrwLog.WBS; txtBudgetHrs.Text = moDrwLog.BudgetHrs.ToString("#,##0.00"); txtPercentComplete.Text = moDrwLog.PercentComplete.ToString("#,##0.00"); txtRemainingHrs.Text = moDrwLog.RemainingHrs.ToString("#,##0.00"); txtEarnedHrs.Text = moDrwLog.EarnedHrs.ToString("#,##0.00"); txtTitle1.Text = moDrwLog.Title1; txtTitle2.Text = moDrwLog.Title2; txtTitle3.Text = moDrwLog.Title3; txtTitle4.Text = moDrwLog.Title4; txtTitle5.Text = moDrwLog.Title5; txtTitle6.Text = moDrwLog.Title6; rdoTitle6IsTitle.Checked = moDrwLog.Title6IsTitle; rdoTitle5IsTitle.Checked = moDrwLog.Title5IsTitle; rdoTitle4IsTitle.Checked = moDrwLog.Title4IsTitle; rdoTitle3IsTitle.Checked = moDrwLog.Title3IsTitle; rdoTitle2IsTitle.Checked = moDrwLog.Title2IsTitle; rdoTitle1IsTitle.Checked = moDrwLog.Title1IsTitle; rdoTitle6IsDesc.Checked = moDrwLog.Title6IsDesc; rdoTitle5IsDesc.Checked = moDrwLog.Title5IsDesc; rdoTitle4IsDesc.Checked = moDrwLog.Title4IsDesc; rdoTitle3IsDesc.Checked = moDrwLog.Title3IsDesc; rdoTitle2IsDesc.Checked = moDrwLog.Title2IsDesc; rdoTitle1IsDesc.Checked = moDrwLog.Title1IsDesc; txtRevision.Text = moDrwLog.Revision; rd = new CBReleaseDrawing(); rd.Load(moDrwLog.ReleasedDrawingID); cboIssuedAs.Text = rd.Name; if (moDrwLog.DateRevised == RSLib.COUtility.DEFAULTDATE) { dtpDateRevised.Checked = false; } else { dtpDateRevised.Checked = true; dtpDateRevised.Value = moDrwLog.DateRevised; } if (moDrwLog.DateDue == RSLib.COUtility.DEFAULTDATE) { dtpDateDue.Checked = false; } else { dtpDateDue.Checked = true; dtpDateDue.Value = moDrwLog.DateDue; } if (moDrwLog.DateLate == RSLib.COUtility.DEFAULTDATE) { dtpDateLate.Checked = false; } else { dtpDateLate.Checked = true; dtpDateLate.Value = moDrwLog.DateLate; } bttSave.Enabled = false; bttSaveNew.Enabled = false; }