private List <Models.ProjectDetails> GetDefaultDetailsList(string text, string projectId) { BLL.ProjectDetailsBLL bll = new BLL.ProjectDetailsBLL(); DataTable table = null; //if (!Utils.IsEmptyOrNull(projectId)) //{ // table = bll.GetData(" ProjectId=@ProjectId ", new System.Data.OleDb.OleDbParameter("@parentProjectId", projectId)); //} //else { // table = bll.GetData(); //} table = bll.GetDataByProjectId(this.comboBox1.SelectedValue.ToString(), this.comboBox2.SelectedValue.ToString(), this.comboBox3.SelectedValue.ToString()); List <Models.ProjectDetails> list = new List <Models.ProjectDetails>() { new Models.ProjectDetails() { DetailsId = "", ProjectId = "", DetailsTilte = text } }; list.AddRange(ListSupport.ToList <Models.ProjectDetails>(table)); return(list); }
private void comboBox4_SelectedIndexChanged(object sender, EventArgs e) { Models.ProjectDetails details = new BLL.ProjectDetailsBLL().GetModel(this.comboBox4.SelectedValue.ToString()); if (details != null) { this.Intensity_Label.Text = "【" + details.Intensity + "】"; this.Mileage_Label.Text = "【" + details.Mileage + "】"; this.CementContent_Label.Text = "【" + details.CementContent + "】"; this.MixDesign_Label.Text = "【" + details.MixDesign + "】"; this.SerialNumber_Label.Text = "【" + details.SerialNumber + "】"; } }
private void button3_Click(object sender, EventArgs e) { try { Task.Factory.StartNew(() => { IfSaving = true; BLL.ProjectDetailsBLL bll = new BLL.ProjectDetailsBLL(); bll.SaveList(this.Details); IfSaving = false; MessageBox.Show("保存完成"); }).ContinueWith(a => { MessageBox.Show("保存到数据库失败"); }, TaskContinuationOptions.OnlyOnFaulted); } catch (Exception ex) { MessageBox.Show("保存到数据库失败"); } }