public static string SignUp(string UserDataToAdd) //OK { string retValue = string.Empty; foreach (DataRow dr in jsonStringToTable(UserDataToAdd).Rows) { // New User will be added to database UserDataObj user = new UserDataObj(); user.Username = dr["username"].ToString(); user.Password = dr["password"].ToString(); user.Point = 100; //Default UserReps userRps = new UserReps(); userRps.Insert(user); retValue = CnvDataTableToJsonString(userRps.Athenticate(user)); } return(retValue); }
public static string GetAllScores() //OK { DataTable dtScors = new UserReps().GetScores(); return(CnvDataTableToJsonString(dtScors)); }
public static string EditProfile(string jSonUserRecToEditProfile) //OK { string retValue = string.Empty; foreach (DataRow dr in jsonStringToTable(jSonUserRecToEditProfile).Rows) { UserDataObj user = new UserDataObj(); user.UserID = long.Parse(dr["userID"].ToString()); user.Username = dr["username"].ToString(); user.Password = dr["password"].ToString(); UserReps userRps = new UserReps(); userRps.Update(user); retValue = GetAsJson_Simple("userID", user.UserID.ToString()); } return(retValue); }
public static string GetUserRec(string json_userID) //OK { long userID = long.Parse(GetSingleValueFromJson(json_userID, "userID")); UserDataObj user = new UserDataObj(); user.UserID = userID; DataTable dtPlayers = new UserReps().GetUserRec(user); return(CnvDataTableToJsonString(dtPlayers)); }
// Define Set public static string DefineSet(string jSonUserRecToDefineSet) //OK { string retValue = string.Empty; UserDataObj user = new UserDataObj(); foreach (DataRow dr in jsonStringToTable(jSonUserRecToDefineSet).Rows) { user.UserID = long.Parse(dr["userID"].ToString()); user.Set = dr["set"].ToString(); retValue = new UserReps().UpdateSet(user); } return(retValue); }
public string SignIn(string UserDataToSignIn) //OK { string retValue = string.Empty; foreach (DataRow dr in jsonStringToTable(UserDataToSignIn).Rows) { UserDataObj user = new UserDataObj(); user.Username = dr["username"].ToString(); user.Password = dr["password"].ToString(); UserReps userRps = new UserReps(); userRps.Athenticate(user); retValue = JSonUtil_Server.CnvDataTableToJsonString(userRps.Athenticate(user)); } return(retValue); }