/// <summary> /// 增加一条数据 /// </summary> public int Add(Hownet.Model.ProductWorkingMain model) { return(dal.Add(model)); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(Hownet.Model.ProductWorkingMain model) { dal.Update(model); }
/// <summary> /// 获得数据列表 /// </summary> public List <Hownet.Model.ProductWorkingMain> DataTableToList(DataTable dt) { List <Hownet.Model.ProductWorkingMain> modelList = new List <Hownet.Model.ProductWorkingMain>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { Hownet.Model.ProductWorkingMain model; for (int n = 0; n < rowsCount; n++) { model = new Hownet.Model.ProductWorkingMain(); if (dt.Rows[n]["ID"].ToString() != "") { model.ID = int.Parse(dt.Rows[n]["ID"].ToString()); } if (dt.Rows[n]["MaterielID"].ToString() != "") { model.MaterielID = int.Parse(dt.Rows[n]["MaterielID"].ToString()); } if (dt.Rows[n]["CompanyID"].ToString() != "") { model.CompanyID = int.Parse(dt.Rows[n]["CompanyID"].ToString()); } if (dt.Rows[n]["TaskID"].ToString() != "") { model.TaskID = int.Parse(dt.Rows[n]["TaskID"].ToString()); } if (dt.Rows[n]["DateTime"].ToString() != "") { model.DateTime = DateTime.Parse(dt.Rows[n]["DateTime"].ToString()); } model.Ver = dt.Rows[n]["Ver"].ToString(); if (dt.Rows[n]["FillDate"].ToString() != "") { model.FillDate = DateTime.Parse(dt.Rows[n]["FillDate"].ToString()); } if (dt.Rows[n]["FillMan"].ToString() != "") { model.FillMan = int.Parse(dt.Rows[n]["FillMan"].ToString()); } if (dt.Rows[n]["VerifyDate"].ToString() != "") { model.VerifyDate = DateTime.Parse(dt.Rows[n]["VerifyDate"].ToString()); } if (dt.Rows[n]["VerifyMan"].ToString() != "") { model.VerifyMan = int.Parse(dt.Rows[n]["VerifyMan"].ToString()); } if (dt.Rows[n]["IsDefault"].ToString() != "") { if ((dt.Rows[n]["IsDefault"].ToString() == "1") || (dt.Rows[n]["IsDefault"].ToString().ToLower() == "true")) { model.IsDefault = true; } else { model.IsDefault = false; } } if (dt.Rows[n]["IsEnd"].ToString() != "") { model.IsEnd = int.Parse(dt.Rows[n]["IsEnd"].ToString()); } if (dt.Rows[n]["IsUse"].ToString() != "") { if ((dt.Rows[n]["IsUse"].ToString() == "1") || (dt.Rows[n]["IsUse"].ToString().ToLower() == "true")) { model.IsUse = true; } else { model.IsUse = false; } } model.Remark = dt.Rows[n]["Remark"].ToString(); model.A = int.Parse(dt.Rows[n]["A"].ToString()); modelList.Add(model); } } return(modelList); }