/// <summary> /// 获得数据列表 /// </summary> public List <HM.Model.Qm.Tb_Qm_Standard> DataTableToList(DataTable dt) { List <HM.Model.Qm.Tb_Qm_Standard> modelList = new List <HM.Model.Qm.Tb_Qm_Standard>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { HM.Model.Qm.Tb_Qm_Standard model; for (int n = 0; n < rowsCount; n++) { model = new HM.Model.Qm.Tb_Qm_Standard(); model.Id = dt.Rows[n]["Id"].ToString(); model.Code = dt.Rows[n]["Code"].ToString(); model.SuitableItemTypeId = dt.Rows[n]["SuitableItemTypeId"].ToString(); model.Professional = dt.Rows[n]["Professional"].ToString(); model.Type = dt.Rows[n]["Type"].ToString(); model.TypeDescription = dt.Rows[n]["TypeDescription"].ToString(); model.CheckStandard = dt.Rows[n]["CheckStandard"].ToString(); model.CheckWay = dt.Rows[n]["CheckWay"].ToString(); if (dt.Rows[n]["Point"].ToString() != "") { model.Point = decimal.Parse(dt.Rows[n]["Point"].ToString()); } if (dt.Rows[n]["IsCoerce"].ToString() != "") { model.IsCoerce = int.Parse(dt.Rows[n]["IsCoerce"].ToString()); } if (dt.Rows[n]["IsUse"].ToString() != "") { model.IsUse = int.Parse(dt.Rows[n]["IsUse"].ToString()); } if (dt.Rows[n]["IsDelete"].ToString() != "") { model.IsDelete = int.Parse(dt.Rows[n]["IsDelete"].ToString()); } if (dt.Rows[n]["Sort"].ToString() != "") { model.Sort = int.Parse(dt.Rows[n]["Sort"].ToString()); } modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(HM.Model.Qm.Tb_Qm_Standard model) { dal.Update(model); }
/// <summary> /// 增加一条数据 /// </summary> public void Add(HM.Model.Qm.Tb_Qm_Standard model) { dal.Add(model); }