// //////////////////////////////////////////////////////////////////////// // STEP1 - GENERAL INFORMATION - METHODS // private void StepGeneralInformationIn() { // Set instruction Label instruction = (Label)this.Master.FindControl("lblInstruction"); instruction.Text = "Please provide general information"; if (rbtnBeginTemplate.Checked) { int costingSheetTemplateId = Int32.Parse(hdfSelectedIdTemplate.Value); if (costingSheetTemplateId != 0) { // Prepare initial data // ... for template foreach (ProjectCostingSheetAddTDS.TemplateInformationRow row in (ProjectCostingSheetAddTDS.TemplateInformationDataTable)Session["templateInformation"]) { if (row.CostingSheetTemplateID == costingSheetTemplateId) { tbxName.Text = row.Name; cbxRehabAssessmentData.Checked = row.RAData; cbxFullLengthLiningData.Checked = row.FLLData; cbxPointRepairData.Checked = row.PRData; ; cbxJunctionLiningData.Checked = row.JLData; cbxManholeRehabData.Checked = row.MRData; cbxMobilizationData.Checked = row.MOBData; cbxOtherData.Checked = row.OtherData; cbxLabourHour.Checked = row.LabourHourData; cbxTrucksEquipment.Checked = row.UnitData; cbxMaterial.Checked = row.MaterialData; cbxSubcontractor.Checked = row.SubcontractorData; cbxOtherCost.Checked = row.MiscData; cbxRevenueInformation.Checked = row.RevenueIncluded; luEndSaveTemplate.SelectedValue = row.CostingSheetTemplateID.ToString(); try { DateTime startDate = new DateTime(row.Year, row.Month, row.Day); tkrdpFrom.SelectedDate = startDate; } catch { } try { DateTime endDate = new DateTime(row.Year2, row.Month2, row.Day2); tkrdpTo.SelectedDate = endDate; } catch { } } } } //foreach (ProjectTDS.LFS_PROJECTRow row in (ProjectTDS.LFS_PROJECTDataTable)project.Table) //{ // // step 1 // thisId = Convert.ToInt32(row[0].ToString()); // // step 2 // thisName = Convert.ToString(row[8].ToString()); // // step 3 // TreeNode newNode = new TreeNode(thisName, thisId.ToString()); // newNode.ShowCheckBox = true; // newNode.SelectAction = TreeNodeSelectAction.None; // // step 4 // nodes.Add(newNode); // newNode.ToggleExpandState(); //} } Int32 thisId; String thisName; TreeNodeCollection nodes; CompaniesGateway companies = new CompaniesGateway(); companies.LoadByCompaniesId(int.Parse(hdfClientId.Value), int.Parse(hdfCompanyId.Value)); string nameCompany = companies.GetName(int.Parse(hdfClientId.Value)); ProjectGateway project = new ProjectGateway(); project.LoadByClientId(int.Parse(hdfClientId.Value)); TreeNode tnParent = new TreeNode(); tnParent.Text = nameCompany; tnParent.Value = "0"; tnParent.ShowCheckBox = true; tnParent.SelectAction = TreeNodeSelectAction.None; tvProjectsRoot.Nodes.Add(tnParent); tnParent.ToggleExpandState(); PopulateNodes(project.Table, tnParent.ChildNodes); }