public static string getQueryUpdateSubCategory(SubCategory subcategory) { return string.Format("UPDATE {0} SET {1}='{2}', {3}='{4}',{5}='{6}',{7}='{8}'WHERE {9}='{10}'", ID_TABLE_SUBCATEGORY, ID_CATEGORY_SUBCATEGORY,subcategory.Category.Id, ID_DESCRIPTION_SUBCATEGORY, subcategory.Description, ID_UPDATETIME_SUBCATEGORY, subcategory.UpdateLocalDateTime.ToString(DATETIMEFORMATINSERT_SUBCATEGORY), ID_UPDATEUSER_SUBCATEGORY, subcategory.UpdateUser, ID_ID_SUBCATEGORY, subcategory.Id ); }
public static string getQuerySaveSubCategory(SubCategory subcategory) { return string.Format("INSERT INTO {0} VALUES('{1}','{2}','{3}','{4}','{5}','{6}','{7}')", ID_TABLE_SUBCATEGORY, subcategory.Id, subcategory.Category.Id, subcategory.Description, subcategory.LocalInsertTime.ToString(DATETIMEFORMATINSERT_SUBCATEGORY), subcategory.InsertUser, subcategory.UpdateLocalDateTime.ToString(DATETIMEFORMATINSERT_SUBCATEGORY), subcategory.UpdateUser); }
public void Update(SubCategory subcategory) { _repositoryHelper.UpdateSubCategory(subcategory); }
public void Save(SubCategory subcategory) { _repositoryHelper.SaveSubCategory(subcategory); }
public bool Exists(SubCategory subcategory) { return Get(subcategory.Id) != null; }
public static IList<SubCategory> ParseDataSetToSubCategory(DataTable dataTable) { IList<SubCategory> subcategoryList = new List<SubCategory>(); foreach (DataRow row in dataTable.Rows) { SubCategory subcategory = new SubCategory() { Id = row[POSITION_ID_SUBCATEGORY].ToString(), Category= new Category(row[POSITION_CATEGORY_SUBCATEGORY].ToString()), Description = row[POSITION_DESCRIPTION_SUBCATEGORY].ToString(), LocalInsertTime = getDateTime(row[POSITION_INSERTTIME_SUBCATEGORY].ToString(),DATETIMEFORMATINSERT_SUBCATEGORY), InsertUser = row[POSITION_INSERTUSER_SUBCATEGORY].ToString(), UpdateLocalDateTime = getDateTime(row[POSITION_UPDATETIME_SUBCATEGORY].ToString(),DATETIMEFORMATINSERT_SUBCATEGORY), UpdateUser = row[POSITION_UPDATEUSER_SUBCATEGORY].ToString() }; subcategoryList.Add(subcategory); } return subcategoryList; }
internal void UpdateSubCategory(SubCategory subcategory) { string query = SubCategoryQuery.getQueryUpdateSubCategory(subcategory); SubCategoryQuery.ParseDataSetToSubCategory(_provider.queryExecute(query,UPDATE_TYPE)); }
internal void SaveSubCategory(SubCategory subcategory) { string query = SubCategoryQuery.getQuerySaveSubCategory(subcategory); SubCategoryQuery.ParseDataSetToSubCategory(_provider.queryExecute(query,INSERT_TYPE)); }