/// <summary> /// 获得数据列表 /// </summary> public List <MobileSoft.Model.SQMSys.Tb_Sys_Field> DataTableToList(DataTable dt) { List <MobileSoft.Model.SQMSys.Tb_Sys_Field> modelList = new List <MobileSoft.Model.SQMSys.Tb_Sys_Field>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { MobileSoft.Model.SQMSys.Tb_Sys_Field model; for (int n = 0; n < rowsCount; n++) { model = new MobileSoft.Model.SQMSys.Tb_Sys_Field(); if (dt.Rows[n]["FieldCode"].ToString() != "") { model.FieldCode = new Guid(dt.Rows[n]["FieldCode"].ToString()); } model.TemplateCode = dt.Rows[n]["TemplateCode"].ToString(); model.FieldSign = dt.Rows[n]["FieldSign"].ToString(); model.FieldName = dt.Rows[n]["FieldName"].ToString(); model.DefaultName = dt.Rows[n]["DefaultName"].ToString(); if (dt.Rows[n]["FieldOrderID"].ToString() != "") { model.FieldOrderID = int.Parse(dt.Rows[n]["FieldOrderID"].ToString()); } if (dt.Rows[n]["FieldType"].ToString() != "") { model.FieldType = int.Parse(dt.Rows[n]["FieldType"].ToString()); } if (dt.Rows[n]["FieldLength"].ToString() != "") { model.FieldLength = int.Parse(dt.Rows[n]["FieldLength"].ToString()); } if (dt.Rows[n]["IsUsed"].ToString() != "") { model.IsUsed = int.Parse(dt.Rows[n]["IsUsed"].ToString()); } modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(MobileSoft.Model.SQMSys.Tb_Sys_Field model) { dal.Update(model); }
/// <summary> /// 增加一条数据 /// </summary> public void Add(MobileSoft.Model.SQMSys.Tb_Sys_Field model) { dal.Add(model); }