public response Update(int id, string fieldValueCollection) { //Stadiu item = JsonConvert.DeserializeObject<Stadiu>(Find(id).Message); Stadiu item = (Stadiu)(Find(id).Result); return(item.Update(fieldValueCollection)); }
public response GetAll() { try { DataAccess da = new DataAccess(authenticatedUserId, connectionString, CommandType.StoredProcedure, "STADIIsp_select", new object[] { new MySqlParameter("_SORT", null), new MySqlParameter("_ORDER", null), new MySqlParameter("_FILTER", null), new MySqlParameter("_LIMIT", null) }); ArrayList aList = new ArrayList(); MySqlDataReader r = da.ExecuteSelectQuery(); while (r.Read()) { Stadiu a = new Stadiu(authenticatedUserId, connectionString, (IDataRecord)r); aList.Add(a); } r.Close(); r.Dispose(); Stadiu[] toReturn = new Stadiu[aList.Count]; for (int i = 0; i < aList.Count; i++) { toReturn[i] = (Stadiu)aList[i]; } return(new response(true, JsonConvert.SerializeObject(toReturn, CommonFunctions.JsonSerializerSettings), toReturn, null, null)); } catch (Exception exp) { LogWriter.Log(exp); return(new response(false, exp.ToString(), null, null, new System.Collections.Generic.List <Error>() { new Error(exp) })); } }
public response Update(string fieldValueCollection) { Stadiu tmpItem = JsonConvert.DeserializeObject <Stadiu>(fieldValueCollection); // sa vedem daca merge asa sau trebuie cu JObject //return JsonConvert.DeserializeObject<Stadiu>(Find(Convert.ToInt32(tmpItem.ID)).Message).Update(fieldValueCollection); return(((Stadiu)(Find(Convert.ToInt32(tmpItem.ID)).Result)).Update(fieldValueCollection)); }
public response Find(int _id) { try { Stadiu item = new Stadiu(authenticatedUserId, connectionString, _id); return(new response(true, JsonConvert.SerializeObject(item, CommonFunctions.JsonSerializerSettings), item, null, null));; } catch (Exception exp) { LogWriter.Log(exp); return(new response(false, exp.ToString(), null, null, new System.Collections.Generic.List <Error>() { new Error(exp) })); } }
/// <summary> /// Metoda pt. popularea Stadiului curent /// </summary> /// <returns>SOCISA.StadiiJson</returns> public response GetStadiu() { try { Stadiu toReturn = new Stadiu(authenticatedUserId, connectionString, Convert.ToInt32(this.ID_STADIU)); return(new response(true, Newtonsoft.Json.JsonConvert.SerializeObject(toReturn, CommonFunctions.JsonSerializerSettings), toReturn, null, null)); } catch (Exception exp) { LogWriter.Log(exp); return(new response(false, exp.ToString(), null, null, new List <Error>() { new Error(exp) })); } }
public response GetFiltered(string _sort, string _order, string _filter, string _limit) { try { try { string newFilter = Filtering.GenerateFilterFromJsonObject(typeof(Stadiu), _filter, authenticatedUserId, connectionString); _filter = newFilter == null ? _filter : newFilter; } catch { } DataAccess da = new DataAccess(authenticatedUserId, connectionString, CommandType.StoredProcedure, "STADIIsp_select", new object[] { new MySqlParameter("_SORT", _sort), new MySqlParameter("_ORDER", _order), new MySqlParameter("_FILTER", _filter), new MySqlParameter("_LIMIT", _limit) }); /* * ArrayList aList = new ArrayList(); * MySqlDataReader r = da.ExecuteSelectQuery(); * while (r.Read()) * { * Stadiu a = new Stadiu(authenticatedUserId, connectionString, (IDataRecord)r); * aList.Add(a); * } * r.Close(); r.Dispose(); da.CloseConnection(); * Stadiu[] toReturn = new Stadiu[aList.Count]; * for (int i = 0; i < aList.Count; i++) * toReturn[i] = (Stadiu)aList[i]; * return new response(true, JsonConvert.SerializeObject(toReturn, CommonFunctions.JsonSerializerSettings), toReturn, null, null); */ List <Stadiu> aList = new List <Stadiu>(); MySqlDataReader r = da.ExecuteSelectQuery(); while (r.Read()) { Stadiu a = new Stadiu(authenticatedUserId, connectionString, (IDataRecord)r); aList.Add(a); } r.Close(); r.Dispose(); da.CloseConnection(); return(new response(true, JsonConvert.SerializeObject(aList.ToArray(), CommonFunctions.JsonSerializerSettings), aList.ToArray(), null, null)); } catch (Exception exp) { LogWriter.Log(exp); return(new response(false, exp.ToString(), null, null, new System.Collections.Generic.List <Error>() { new Error(exp) })); } }
public response GetChildren(Stadiu item, string tableName, int childrenId) { return(item.GetChildren(tableName, childrenId)); }
public response GetChildrens(Stadiu item, string tableName) { return(item.GetChildrens(tableName)); }
public response Delete(Stadiu item) { return(item.Delete()); }
public response Update(Stadiu item) { return(item.Update()); }
public response Insert(Stadiu item) { return(item.Insert()); }