private bool dataCollection(string officeCode, string department) { string para = " WHERE OfficeCode = '" + officeCode + "' AND Department = '" + department + "'"; TaskEntryData ted = new TaskEntryData(); tedA = ted.SelectTaskEntryData(para); if (tedA == null) { return(false); } PlanningData[] wkPdA = new PlanningData[tedA.Length]; PlanningData pd = new PlanningData(); int j = 0; for (int i = 0; i < tedA.Length; i++) { pd = pd.LatestPlanningData(tedA[i].TaskEntryID); if (pd == null) { continue; } if (pd.ApPresidentStat == 0) { wkPdA[j] = new PlanningData(); wkPdA[j] = ( PlanningData )pd.Clone(); wkPdA[j].TaskCode = tedA[i].TaskCode; wkPdA[j].TaskName = tedA[i].TaskName; j++; } } if (j == 0) { return(false); } pdA = new PlanningData[j]; for (int i = 0; i < pdA.Length; i++) { pdA[i] = new PlanningData(); pdA[i] = ( PlanningData )wkPdA[i].Clone(); pdA[i].TaskCode = wkPdA[i].TaskCode; pdA[i].TaskName = wkPdA[i].TaskName; } return(true); }
private void displayLabalContents(int entryID) { clearLabel(); if (entryID < 1) { return; } ted = new TaskEntryData(); ted = ted.SelectTaskEntryData(entryID); if (ted == null) { return; } labelPartner.Text = ted.PartnerName; labelTaskPlace.Text = ted.TaskPlace; labelTaskCode.Text = ted.TaskCode; }
private void button_Click(object sender, EventArgs e) { Button btn = ( Button )sender; if (btn.Name == "buttonClose") { this.Close(); return; } if (btn.Name == "buttonStoreMWorkItems") { if (formImpMWorkItems == null || formImpMWorkItems.IsDisposed) { formImpMWorkItems = new FormImpMWorkItems(hp); formImpMWorkItems.Show(); } else { MessageBox.Show(msgAlready); } return; } TaskEntryData itd = new TaskEntryData(); if (btn.Name == "buttonAdd") { //itd.OfficeCode = Convert.ToString( comboBoxOffice.SelectedValue ); //itd.Department = Convert.ToString( comboBoxDepartment.SelectedValue ); //itd.OfficeName = comboBoxOffice.Text; //itd.DepartName = comboBoxDepartment.Text; //labelTaskEntryID.Text = ""; } else { if (labelTaskEntryID.Text == "" || labelTaskEntryID.Text == "0") { DMessage.DataNotEnough(); return; } itd = itd.SelectTaskEntryData(Convert.ToInt32(labelTaskEntryID.Text)); itd.MemberCode = hp.MemberCode; itd.TaxRate = hp.TaxRate; itd.AdminCostRate = hp.AdminCostRate; itd.OthersCostRate = hp.OthersCostRate; itd.Expenses = hp.Expenses; itd.OfficeCode = Conv.OfficeCode; itd.Department = Conv.DepartCode; itd.PartnerName = labelPartner.Text; } switch (btn.Name) { case "buttonEstimate": formEstimate = new FormEstimate(itd); formEstimate.Show(); break; case "buttonPlanning": formPlanning = new FormPlanning(itd); formPlanning.Show(); break; case "buttonOsDetail": formOutsource = new FormOutsource(itd); formOutsource.Show(); break; case "buttonContract": formContract = new FormContract(itd); formContract.Show(); break; case "buttonRegular": formRegular = new FormRegular(itd); formRegular.Show(); break; case "buttonVolumeInvoice": formVolumeInvoice = new FormVolumeInvoice(itd); formVolumeInvoice.Show(); break; case "buttonInvoice": formInvoice = new FormInvoice(itd); formInvoice.Show(); break; //case "buttonDetail": // displayDetailLabel(ted); // break; case "buttonAdd": itd.OfficeCode = Conv.OfficeCode; itd.Department = Conv.DepartCode; itd.OfficeName = Conv.Office; itd.DepartName = Conv.Depart; labelTaskEntryID.Text = ""; itd = FormTaskEntry.DispData(itd); displayDetailLabel(itd); comboBoxCostType.Text = itd.CostType; textBoxTaskName.Text = itd.TaskName; labelPartner.Text = itd.PartnerName; labelTaskPlace.Text = itd.TaskPlace; labelTaskCode.Text = itd.TaskCode; labelTaskEntryID.Text = Convert.ToString(itd.TaskEntryID); // ? 仮版 : 正式版 labelTaskName.Text = (labelTaskCode.Text.Trim() == "") ? "": itd.TaskName; ListFormDataOp lo = new ListFormDataOp(); etcd = lo.SelectTaskEntryNameData(itd.OfficeCode, itd.Department, null); buttonTask.Enabled = string.IsNullOrEmpty(labelTaskCode.Text.Trim()) ? true : false; buttonTask.Visible = string.IsNullOrEmpty(labelTaskCode.Text.Trim()) ? true : false; break; case "buttonTask": if (String.IsNullOrEmpty(textBoxTaskName.Text)) { MessageBox.Show("対応する見積・計画用業務名がありません"); return; } tcds = FormTaskCodeNameList.ReceiveItems(tcd); if (!writeTaskCodeToTaskEntryData()) { return; } if (!displayTaskData(tcds)) { return; } break; default: break; } }
private bool displayTaskData(TaskCodeNameData tcds) { if (tcds == null) { return(false); } textBoxTaskName.Text = tcds.TaskName; if (String.IsNullOrEmpty(tcds.TaskCode.Trim())) { // 仮業務番号で運用中 TaskEntryData tid = new TaskEntryData(); tid = tid.SelectTaskEntryData(tcds.TaskID); MembersData md = new MembersData(); labelLeaderName.Text = "業務責任者: " + md.SelectMemberName(tid.LeaderMCode); labelTaskPlace.Text = tid.TaskPlace; labelSalesMName.Text = "営業責任者: " + md.SelectMemberName(tid.SalesMCode); if (DHandling.CheckDateMiniValue(tid.StartDate)) { labelStartDate.Text = "工期: " + tid.StartDate.ToString("d"); } if (DHandling.CheckDateMiniValue(tid.EndDate)) { labelStartDate.Text += " ~ " + tid.EndDate.ToString("d"); } PartnersData pd = new PartnersData(); labelPartner.Text = pd.SelectPartnerName(tid.PartnerCode); labelPartnerCode.Text = tid.PartnerCode; } else { // 正式な業務番号が設定されている labelTaskCode.Text = tcds.TaskCode; labelTtlTName.Visible = true; labelTaskName.Text = tcds.TaskName; TaskIndData tid = new TaskIndData(); tid = tid.SelectTaskIndData(tcds.TaskCode); if (tid == null) { return(false); } MembersData md = new MembersData(); // 業務担当者名 labelTtlLeader.Visible = true; labelLeaderName.Text = md.SelectMemberName(tid.LeaderMCode); TaskData td = new TaskData(); td = td.SelectTaskData(tid.TaskID); if (td == null) { return(false); } labelTaskPlace.Text = td.TaskPlace; // 営業担当者名 labelTtlSales.Visible = true; labelSalesMName.Text = md.SelectMemberName(td.SalesMCode); labelContractDate.Text = "契約日: " + td.IssueDate.ToString("yyyy/MM/dd"); if (DHandling.CheckDateMiniValue(td.StartDate)) { labelStartDate.Text = "工期: " + td.StartDate.ToString("d"); } if (DHandling.CheckDateMiniValue(td.EndDate)) { labelStartDate.Text += " ~ " + td.EndDate.ToString("d"); } PartnersData pd = new PartnersData(); labelPartner.Text = pd.SelectPartnerName(td.PartnerCode); labelPartnerCode.Text = td.PartnerCode; setTaskCodeToTaskEntryData(tid, td); } return(true); }