/// <summary> /// 增加一条数据 /// </summary> public int Add(Hownet.Model.SizeTableTask model) { return(dal.Add(model)); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(Hownet.Model.SizeTableTask model) { dal.Update(model); }
/// <summary> /// 获得数据列表 /// </summary> public List <Hownet.Model.SizeTableTask> DataTableToList(DataTable dt) { List <Hownet.Model.SizeTableTask> modelList = new List <Hownet.Model.SizeTableTask>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { Hownet.Model.SizeTableTask model; for (int n = 0; n < rowsCount; n++) { model = new Hownet.Model.SizeTableTask(); if (dt.Rows[n]["ID"].ToString() != "") { model.ID = int.Parse(dt.Rows[n]["ID"].ToString()); } else { model.ID = 0; } if (dt.Rows[n]["SizeID"].ToString() != "") { model.SizeID = int.Parse(dt.Rows[n]["SizeID"].ToString()); } else { model.SizeID = 0; } if (dt.Rows[n]["SizePartID"].ToString() != "") { model.SizePartID = int.Parse(dt.Rows[n]["SizePartID"].ToString()); } else { model.SizePartID = 0; } if (dt.Rows[n]["TaskID"].ToString() != "") { model.TaskID = int.Parse(dt.Rows[n]["TaskID"].ToString()); } else { model.TaskID = 0; } if (dt.Rows[n]["Length"].ToString() != "") { model.Length = decimal.Parse(dt.Rows[n]["Length"].ToString()); } else { model.Length = 0; } if (dt.Rows[n]["MaterielID"].ToString() != "") { model.MaterielID = int.Parse(dt.Rows[n]["MaterielID"].ToString()); } else { model.MaterielID = 0; } model.A = int.Parse(dt.Rows[n]["A"].ToString()); modelList.Add(model); } } return(modelList); }