public static string getQueryUpdateLoadType(LoadType loadType) { return string.Format("UPDATE {0} SET {1}='{2}', {3}='{4}',{5}='{6}'WHERE {7}='{8}'", ID_TABLE_LOADTYPE, ID_DESCRIPTION_LOADTYPE, loadType.Description, ID_UPDATETIME_LOADTYPE, loadType.UpdateLocalDateTime.ToString(DATETIMEFORMATINSERT_LOADTYPE), ID_UPDATEUSER_LOADTYPE, loadType.UpdateUser, ID_ID_LOADTYPE, loadType.Id ); }
public static string getQuerySaveLoadType(LoadType loadType) { return string.Format("INSERT INTO {0} VALUES('{1}','{2}','{3}','{4}','{5}','{6}')", ID_TABLE_LOADTYPE, loadType.Id, loadType.Description, loadType.LocalInsertTime.ToString(DATETIMEFORMATINSERT_LOADTYPE), loadType.InsertUser, loadType.UpdateLocalDateTime.ToString(DATETIMEFORMATINSERT_LOADTYPE), loadType.UpdateUser); }
public static IList<LoadType> ParseDataSetToLoadType(DataTable dataTable) { IList<LoadType> loadTypeList = new List<LoadType>(); foreach (DataRow row in dataTable.Rows) { LoadType loadType = new LoadType() { Id = row[POSITION_ID_LOADTYPE].ToString(), Description = row[POSITION_DESCRIPTION_LOADTYPE].ToString(), LocalInsertTime = getDateTime(row[POSITION_INSERTTIME_LOADTYPE].ToString(), DATETIMEFORMATINSERT_LOADTYPE), InsertUser = row[POSITION_INSERTUSER_LOADTYPE].ToString(), UpdateLocalDateTime = getDateTime(row[POSITION_UPDATETIME_LOADTYPE].ToString(), DATETIMEFORMATINSERT_LOADTYPE), UpdateUser = row[POSITION_UPDATEUSER_LOADTYPE].ToString() }; loadTypeList.Add(loadType); } return loadTypeList; }
public void Update(LoadType loadType) { _repositoryHelper.UpdateLoadType(loadType); }
public void Save(LoadType loadType) { _repositoryHelper.SaveLoadType(loadType); }
public bool Exists(LoadType loadType) { return Get(loadType.Id) != null; }
internal void UpdateLoadType(LoadType loadType) { string query = LoadTypeQuery.getQueryUpdateLoadType(loadType); LoadTypeQuery.ParseDataSetToLoadType(_provider.queryExecute(query,UPDATE_TYPE)); }
internal void SaveLoadType(LoadType loadType) { string query = LoadTypeQuery.getQuerySaveLoadType(loadType); LoadTypeQuery.ParseDataSetToLoadType(_provider.queryExecute(query,INSERT_TYPE)); }