private bool dispTaskInformation(string taskCode) { ListFormDataOp lo = new ListFormDataOp(); TaskCodeNameData tcnd = lo.SelectTaskCodeNameData(taskCode, Convert.ToString(comboBoxOffice.SelectedValue)); TaskData td = lo.SelectTaskData(taskCode); if (td == null) { return(false); } labelTaskName.Text = td.TaskName; labelTerm.Text = "工期:"; labelTerm.Text += (td.StartDate.StripTime()).ToString("yyyy年MM月dd日") + " ~ "; labelTerm.Text += (td.EndDate.StripTime()).ToString("yyyy年MM月dd日"); if (td.PartnerCode != null) { PartnersData pd = new PartnersData(); labelPartnerName.Text = pd.SelectPartnerName(td.PartnerCode); } return(true); }
private bool dispTaskInformation(string taskCode) { ListFormDataOp lo = new ListFormDataOp(); TaskCodeNameData tcnd = lo.SelectTaskCodeNameData(taskCode, Convert.ToString(comboBoxOffice.SelectedValue)); TaskData td = lo.SelectTaskData(taskCode); if (td == null) { return(false); } textBoxTaskName.Text = td.TaskName; labelTaskPlace.Text = td.TaskPlace; labelStartDate.Text = (td.StartDate.StripTime()).ToString("yyyy年MM月dd日"); labelEndDate.Text = (td.EndDate.StripTime()).ToString("yyyy年MM月dd日"); labelSalesMCode.Text = td.SalesMCode; DataTable dt; DataRow dr; SqlHandling sql; if (td.PartnerCode != null) { sql = new SqlHandling("M_Partners"); if ((dt = sql.SelectAllData("WHERE PartnerCode = '" + td.PartnerCode + "'")) != null) { dr = dt.Rows[0]; labelPartnerName.Text = Convert.ToString(dr["PartnerName"]); labelPartnerCode.Text = Convert.ToString(dr["PartnerCode"]); } } // 20190302 asakawa // add start labelLeaderMName.Text = ""; labelSalesMName.Text = ""; // add end //if (tcnd.LeaderMCode != null && tcnd.LeaderMCode != " ") if (tcnd != null && tcnd.LeaderMCode != null && tcnd.LeaderMCode != " ") { sql = new SqlHandling("M_Members"); if ((dt = sql.SelectAllData("WHERE MemberCode = '" + tcnd.LeaderMCode + "'")) != null) { dr = dt.Rows[0]; labelLeaderMName.Text = Convert.ToString(dr["Name"]); labelLeaderMCode.Text = tcnd.LeaderMCode; } } if (td.SalesMCode != " ") { sql = new SqlHandling("M_Members"); if ((dt = sql.SelectAllData("WHERE MemberCode = '" + td.SalesMCode + "'")) != null) { dr = dt.Rows[0]; labelSalesMName.Text = Convert.ToString(dr["Name"]); } } return(true); }