public List <Chain.Model.SymbolShow> DataTableToList(DataTable dt) { List <Chain.Model.SymbolShow> modelList = new List <Chain.Model.SymbolShow>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { for (int i = 0; i < rowsCount; i++) { Chain.Model.SymbolShow model = new Chain.Model.SymbolShow(); if (dt.Rows[i]["SymbolID"] != null && dt.Rows[i]["SymbolID"].ToString() != "") { model.SymbolID = int.Parse(dt.Rows[i]["SymbolID"].ToString()); } if (dt.Rows[i]["SymbolTitle"] != null && dt.Rows[i]["SymbolTitle"].ToString() != "") { model.SymbolTitle = dt.Rows[i]["SymbolTitle"].ToString(); } if (dt.Rows[i]["SymbolPhoto"] != null && dt.Rows[i]["SymbolPhoto"].ToString() != "") { model.SymbolPhoto = dt.Rows[i]["SymbolPhoto"].ToString(); } if (dt.Rows[i]["SymbolDesc"] != null && dt.Rows[i]["SymbolDesc"].ToString() != "") { model.SymbolDesc = dt.Rows[i]["SymbolDesc"].ToString(); } if (dt.Rows[i]["SymbolTime"] != null && dt.Rows[i]["SymbolTime"].ToString() != "") { model.SymbolTime = DateTime.Parse(dt.Rows[i]["SymbolTime"].ToString()); } modelList.Add(model); } } return(modelList); }
public bool Update(Chain.Model.SymbolShow model) { return(this.dal.Update(model)); }
public int Add(Chain.Model.SymbolShow model) { return(this.dal.Add(model)); }