/// <summary> /// 获得数据列表 /// </summary> public List <Hownet.Model.Bas_TestingManager> DataTableToList(DataTable dt) { List <Hownet.Model.Bas_TestingManager> modelList = new List <Hownet.Model.Bas_TestingManager>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { Hownet.Model.Bas_TestingManager model; for (int n = 0; n < rowsCount; n++) { model = new Hownet.Model.Bas_TestingManager(); model.TestingNo = dt.Rows[n]["TestingNo"].ToString(); model.ProCnName = dt.Rows[n]["ProCnName"].ToString(); model.ProEnName = dt.Rows[n]["ProEnName"].ToString(); model.QualityReq_C = dt.Rows[n]["QualityReq_C"].ToString(); model.QualityReq_E = dt.Rows[n]["QualityReq_E"].ToString(); model.StandardReq_C = dt.Rows[n]["StandardReq_C"].ToString(); model.StandardReq_E = dt.Rows[n]["StandardReq_E"].ToString(); model.Remark = dt.Rows[n]["Remark"].ToString(); if (dt.Rows[n]["AutoInc"] != null && dt.Rows[n]["AutoInc"].ToString() != "") { model.AutoInc = int.Parse(dt.Rows[n]["AutoInc"].ToString()); } if (dt.Rows[n]["IsDef"] != null && dt.Rows[n]["IsDef"].ToString() != "") { if ((dt.Rows[n]["IsDef"].ToString() == "1") || (dt.Rows[n]["IsDef"].ToString().ToLower() == "true")) { model.IsDef = true; } else { model.IsDef = false; } } if (dt.Rows[n]["IsEnd"] != null && dt.Rows[n]["IsEnd"].ToString() != "") { model.IsEnd = int.Parse(dt.Rows[n]["IsEnd"].ToString()); } modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Hownet.Model.Bas_TestingManager model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(Hownet.Model.Bas_TestingManager model) { return(dal.Add(model)); }