public Model_SystemLogFileSync DataRowToModel(DataRow row) { Model_SystemLogFileSync sync = new Model_SystemLogFileSync(); if (row != null) { if (row["SystemLogFileSyncID"] != null) { sync.SystemLogFileSyncID = row["SystemLogFileSyncID"].ToString(); } if (row["SyncUrl"] != null) { sync.SyncUrl = row["SyncUrl"].ToString(); } if ((row["FileSize"] != null) && (row["FileSize"].ToString() != "")) { sync.FileSize = new decimal?(decimal.Parse(row["FileSize"].ToString())); } if (row["ErrorMark"] != null) { sync.ErrorMark = row["ErrorMark"].ToString(); } if (row["MsgType"] != null) { sync.MsgType = row["MsgType"].ToString(); } if ((row["CreateTime"] != null) && (row["CreateTime"].ToString() != "")) { sync.CreateTime = new DateTime?(DateTime.Parse(row["CreateTime"].ToString())); } } return sync; }
public bool Add(Model_SystemLogFileSync model) { StringBuilder builder = new StringBuilder(); builder.Append("insert into SystemLogFileSync("); builder.Append("SystemLogFileSyncID,SyncUrl,FileSize,ErrorMark,MsgType,CreateTime)"); builder.Append(" values ("); builder.Append("@SystemLogFileSyncID,@SyncUrl,@FileSize,@ErrorMark,@MsgType,@CreateTime)"); SqlParameter[] cmdParms = new SqlParameter[] { new SqlParameter("@SystemLogFileSyncID", SqlDbType.Char, 0x24), new SqlParameter("@SyncUrl", SqlDbType.VarChar, 300), new SqlParameter("@FileSize", SqlDbType.Decimal, 9), new SqlParameter("@ErrorMark", SqlDbType.VarChar, 500), new SqlParameter("@MsgType", SqlDbType.VarChar, 10), new SqlParameter("@CreateTime", SqlDbType.DateTime) }; cmdParms[0].Value = model.SystemLogFileSyncID; cmdParms[1].Value = model.SyncUrl; cmdParms[2].Value = model.FileSize; cmdParms[3].Value = model.ErrorMark; cmdParms[4].Value = model.MsgType; cmdParms[5].Value = model.CreateTime; return (DbHelperSQL.ExecuteSql(builder.ToString(), cmdParms) > 0); }
public List <Model_SystemLogFileSync> DataTableToList(DataTable dt) { List <Model_SystemLogFileSync> list = new List <Model_SystemLogFileSync>(); int count = dt.Rows.Count; if (count > 0) { for (int i = 0; i < count; i++) { Model_SystemLogFileSync item = this.dal.DataRowToModel(dt.Rows[i]); if (item != null) { list.Add(item); } } } return(list); }
public bool Update(Model_SystemLogFileSync model) { StringBuilder builder = new StringBuilder(); builder.Append("update SystemLogFileSync set "); builder.Append("SyncUrl=@SyncUrl,"); builder.Append("FileSize=@FileSize,"); builder.Append("ErrorMark=@ErrorMark,"); builder.Append("MsgType=@MsgType,"); builder.Append("CreateTime=@CreateTime"); builder.Append(" where SystemLogFileSyncID=@SystemLogFileSyncID "); SqlParameter[] cmdParms = new SqlParameter[] { new SqlParameter("@SyncUrl", SqlDbType.VarChar, 300), new SqlParameter("@FileSize", SqlDbType.Decimal, 9), new SqlParameter("@ErrorMark", SqlDbType.VarChar, 500), new SqlParameter("@MsgType", SqlDbType.VarChar, 10), new SqlParameter("@CreateTime", SqlDbType.DateTime), new SqlParameter("@SystemLogFileSyncID", SqlDbType.Char, 0x24) }; cmdParms[0].Value = model.SyncUrl; cmdParms[1].Value = model.FileSize; cmdParms[2].Value = model.ErrorMark; cmdParms[3].Value = model.MsgType; cmdParms[4].Value = model.CreateTime; cmdParms[5].Value = model.SystemLogFileSyncID; return (DbHelperSQL.ExecuteSql(builder.ToString(), cmdParms) > 0); }
public bool Add(Model_SystemLogFileSync model) { return(this.dal.Add(model)); }
public bool Update(Model_SystemLogFileSync model) { return(this.dal.Update(model)); }