/// <summary> /// 获得数据列表 /// </summary> public List <Maticsoft.Model.ComPany> DataTableToList(DataTable dt) { List <Maticsoft.Model.ComPany> modelList = new List <Maticsoft.Model.ComPany>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { Maticsoft.Model.ComPany model; for (int n = 0; n < rowsCount; n++) { model = new Maticsoft.Model.ComPany(); if (dt.Rows[n]["CompanyID"].ToString() != "") { model.CompanyID = int.Parse(dt.Rows[n]["CompanyID"].ToString()); } model.CompanyNames = dt.Rows[n]["CompanyNames"].ToString(); model.CompanyType = dt.Rows[n]["CompanyType"].ToString(); model.Fanren = dt.Rows[n]["Fanren"].ToString(); model.ComAddress = dt.Rows[n]["ComAddress"].ToString(); model.ComFax = dt.Rows[n]["ComFax"].ToString(); model.ComPhoto = dt.Rows[n]["ComPhoto"].ToString(); model.ComEmail = dt.Rows[n]["ComEmail"].ToString(); model.QQ = dt.Rows[n]["QQ"].ToString(); model.Comwangzhi = dt.Rows[n]["Comwangzhi"].ToString(); model.comconten = dt.Rows[n]["comconten"].ToString(); modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Maticsoft.Model.ComPany model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(Maticsoft.Model.ComPany model) { return(dal.Add(model)); }