public static bool API_UserLogin(string pUserName, string pPassword) { try { string url = string.Concat(new string[] { formMain.GprsServer, "user/login.json?entity.username="******"&entity.password="******"success"].ToObject <bool>()) { JArray jArray2 = GprsAdministrator.Json2JArray("[" + jArray[0]["entity"].ToString() + "]"); GprsAdministrator.Entity_UserType = jArray2[0]["userType"].ToObject <string>(); GprsAdministrator.Entity_Sign = jArray2[0]["sign"].ToObject <string>(); GprsAdministrator.Entity_ID = jArray2[0]["id"].ToObject <string>(); GprsAdministrator.Entity_Username = jArray2[0]["username"].ToObject <string>(); GprsAdministrator.Entity_Password = jArray2[0]["password"].ToObject <string>(); GprsAdministrator.Entity_IsSupper = false; result = true; return(result); } GprsAdministrator.Entity_UserType = ""; GprsAdministrator.Entity_Sign = ""; GprsAdministrator.Entity_ID = ""; GprsAdministrator.Entity_Username = ""; GprsAdministrator.Entity_IsSupper = false; GprsAdministrator.Entity_PhoneNnumber = ""; GprsAdministrator.Entity_Email = ""; GprsAdministrator.Entity_Address = ""; GprsAdministrator.Entity_CreateAt = ""; GprsAdministrator.Entity_UpdateAt = ""; GprsAdministrator.Message = jArray[0]["message"].ToString(); result = false; return(result); } catch { GprsAdministrator.Message = formMain.ML.GetStr("GPRS_AccessError"); } return(false); }
public static bool API_UserChangePassword(string pID, string pOldPassword, string pNewPassword) { string text = formMain.GprsServer + "user/changePassword.json?"; text = text + "entity.id=" + GprsAdministrator.Entity_ID; text = text + "&oldPassword="******"&newPassword="******"message"].ToString(); return(jArray[0]["success"].ToObject <bool>()); }
public static bool API_RemoveAdmin(string pID) { string text = formMain.GprsServer + "admin/remove.json?"; text = text + "admin.id=" + GprsAdministrator.Entity_ID; text = text + "&admin.username="******"&admin.userType=" + GprsAdministrator.Entity_UserType; text = text + "&admin.sign=" + GprsAdministrator.Entity_Sign; text = text + "&entity.id=" + pID + GprsAdministrator.GetTimeStamp(); string webClient = GprsAdministrator.GetWebClient(text); JArray jArray = GprsAdministrator.Json2JArray(webClient); GprsAdministrator.Message = jArray[0]["message"].ToString(); return(jArray[0]["success"].ToObject <bool>()); }
public static bool API_AdminUnbindDevice(string pUserID, string pDeviceID) { string text = formMain.GprsServer + "terminal/unbindToUserByAdmin.json?"; text = text + "admin.id=" + GprsAdministrator.Entity_ID; text = text + "&admin.userType=" + GprsAdministrator.Entity_UserType; text = text + "&admin.username="******"&admin.sign=" + GprsAdministrator.Entity_Sign; text = text + "&entity.id=" + pDeviceID; text = text + "&user.id=" + pUserID + GprsAdministrator.GetTimeStamp(); string webClient = GprsAdministrator.GetWebClient(text); JArray jArray = GprsAdministrator.Json2JArray(webClient); GprsAdministrator.Message = jArray[0]["message"].ToString(); return(jArray[0]["success"].ToObject <bool>()); }
public static bool API_AdminLogin(string pUserName, string pPassword) { string url = formMain.GprsServer + "admin/login.json"; string param = string.Concat(new string[] { "entity.username="******"&entity.password="******"success"].ToObject <bool>()) { JArray jArray2 = GprsAdministrator.Json2JArray("[" + jArray[0]["entity"].ToString() + "]"); GprsAdministrator.Entity_UserType = jArray2[0]["userType"].ToObject <string>(); GprsAdministrator.Entity_Sign = jArray2[0]["sign"].ToObject <string>(); GprsAdministrator.Entity_ID = jArray2[0]["id"].ToObject <string>(); GprsAdministrator.Entity_Username = jArray2[0]["username"].ToObject <string>(); GprsAdministrator.Entity_IsSupper = jArray2[0]["isSuper"].ToObject <bool>(); GprsAdministrator.Entity_PhoneNnumber = jArray2[0]["phoneNumber"].ToObject <string>(); GprsAdministrator.Entity_Email = jArray2[0]["email"].ToObject <string>(); GprsAdministrator.Entity_Address = jArray2[0]["address"].ToObject <string>(); GprsAdministrator.Entity_CreateAt = jArray2[0]["createdAt"].ToObject <string>(); GprsAdministrator.Entity_UpdateAt = jArray2[0]["updatedAt"].ToObject <string>(); return(true); } GprsAdministrator.Entity_UserType = ""; GprsAdministrator.Entity_Sign = ""; GprsAdministrator.Entity_ID = ""; GprsAdministrator.Entity_Username = ""; GprsAdministrator.Entity_IsSupper = false; GprsAdministrator.Entity_PhoneNnumber = ""; GprsAdministrator.Entity_Email = ""; GprsAdministrator.Entity_Address = ""; GprsAdministrator.Entity_CreateAt = ""; GprsAdministrator.Entity_UpdateAt = ""; GprsAdministrator.Message = jArray[0]["message"].ToString(); return(false); }
public static JArray API_GetAdminList() { string text = formMain.GprsServer + "admin/list.json?"; text = text + "admin.id=" + GprsAdministrator.Entity_ID; text = text + "&admin.username="******"&admin.userType=" + GprsAdministrator.Entity_UserType; text = text + "&admin.sign=" + GprsAdministrator.Entity_Sign; string webClient = GprsAdministrator.GetWebClient(text); JArray jArray = GprsAdministrator.Json2JArray(webClient); if (jArray[0]["success"].ToObject <bool>()) { return(GprsAdministrator.Json2JArray(jArray[0]["entities"].ToString())); } return(null); }
public static JArray API_AdminGetUserInfo(string pUserName) { string text = formMain.GprsServer + "user/findByUsernameForAdmin.json?"; text = text + "admin.id=" + GprsAdministrator.Entity_ID; text = text + "&admin.userType=" + GprsAdministrator.Entity_UserType; text = text + "&admin.username="******"&admin.sign=" + GprsAdministrator.Entity_Sign + GprsAdministrator.GetTimeStamp(); text = text + "&entity.username="******"message"].ToString(); if (jArray[0]["success"].ToObject <bool>()) { return(GprsAdministrator.Json2JArray(jArray[0]["entity"].ToString())); } return(null); }
public static JArray API_GetUserList(int pPage) { string text = formMain.GprsServer + "user/listByAdmin.json?"; text = text + "admin.id=" + GprsAdministrator.Entity_ID; text = text + "&admin.username="******"&admin.userType=" + GprsAdministrator.Entity_UserType; text = text + "&admin.sign=" + GprsAdministrator.Entity_Sign; text = text + "&page=" + pPage.ToString(); text = text + "&rows=100" + GprsAdministrator.GetTimeStamp(); string webClient = GprsAdministrator.GetWebClient(text); JArray jArray = GprsAdministrator.Json2JArray(webClient); if (jArray[0]["success"].ToObject <bool>()) { return(GprsAdministrator.Json2JArray(jArray[0]["entities"].ToString())); } return(null); }
public static bool API_EditAdministrator(string pID, string pName, string pPassword, string pPhoneNumber, string pEmail, string pAddress) { string text = formMain.GprsServer + "admin/update.json?"; text = text + "admin.id=" + GprsAdministrator.Entity_ID; text = text + "&admin.username="******"&admin.userType=" + GprsAdministrator.Entity_UserType; text = text + "&admin.sign=" + GprsAdministrator.Entity_Sign; text = text + "&entity.id=" + pID; text = text + "&entity.username="******"&entity.phoneNumber=" + pPhoneNumber; text = text + "&entity.email=" + pEmail; text = text + "&entity.address=" + pAddress + GprsAdministrator.GetTimeStamp(); string webClient = GprsAdministrator.GetWebClient(text); JArray jArray = GprsAdministrator.Json2JArray(webClient); GprsAdministrator.Message = jArray[0]["message"].ToString(); return(jArray[0]["success"].ToObject <bool>()); }
public static bool API_UserUpdateDeviceInfo(string pValueString) { string url = formMain.GprsServer + "terminal/updateByUser.json"; string text = "user.id=" + GprsAdministrator.Entity_ID; text = text + "&user.userType=" + GprsAdministrator.Entity_UserType; text = text + "&user.username="******"&user.sign=", GprsAdministrator.Entity_Sign, pValueString, GprsAdministrator.GetTimeStamp() }); string webClient = GprsAdministrator.GetWebClient(url, text); JArray jArray = GprsAdministrator.Json2JArray(webClient); return(jArray[0]["success"].ToObject <bool>()); }
public static bool API_CreateUser() { string text = formMain.GprsServer + "user/generateUser.json?"; text = text + "admin.id=" + GprsAdministrator.Entity_ID; text = text + "&admin.userType=" + GprsAdministrator.Entity_UserType; text = text + "&admin.username="******"&admin.sign=" + GprsAdministrator.Entity_Sign + GprsAdministrator.GetTimeStamp(); string webClient = GprsAdministrator.GetWebClient(text); JArray jArray = GprsAdministrator.Json2JArray(webClient); GprsAdministrator.Message = jArray[0]["message"].ToString(); if (jArray[0]["success"].ToObject <bool>()) { JArray jArray2 = GprsAdministrator.Json2JArray(jArray[0]["entity"].ToString()); GprsAdministrator.lastuserid = jArray2[0]["id"].ToString(); GprsAdministrator.lastUsername = jArray2[0]["username"].ToString(); GprsAdministrator.lastPassword = jArray2[0]["password"].ToString(); return(true); } return(false); }
public static bool API_UserUnBindNewDevice(string pDevideID) { string url = formMain.GprsServer + "terminal/unbindFromSelf.json"; string text = "user.id=" + GprsAdministrator.Entity_ID; text = text + "&user.userType=" + GprsAdministrator.Entity_UserType; text = text + "&user.username="******"&user.sign=", GprsAdministrator.Entity_Sign, "&Time=", GprsAdministrator.GetTimeStamp() }); text = text + "&entity.id=" + pDevideID; string webClient = GprsAdministrator.GetWebClient(url, text); JArray jArray = GprsAdministrator.Json2JArray(webClient); return(jArray[0]["success"].ToObject <bool>()); }
public static bool API_CheckUserAdvancedPassword(string pPassword) { string url = formMain.GprsServer + "user/verifyAdvancedPassword.json"; string text = "user.id=" + GprsAdministrator.Entity_ID; text = text + "&user.userType=" + GprsAdministrator.Entity_UserType; text = text + "&user.username="******"&user.sign=", GprsAdministrator.Entity_Sign, "&Time=", GprsAdministrator.GetTimeStamp() }); text = text + "&entity.advancedPassword="******"success"].ToObject <bool>()); }
public static bool API_ImportDevice(string pDeviceID, string pUserId, string pModel) { string text = formMain.GprsServer + "terminal/createByAdmin.json?"; text = text + "admin.id=" + GprsAdministrator.Entity_ID; text = text + "&admin.userType=" + GprsAdministrator.Entity_UserType; text = text + "&admin.username="******"&admin.sign=" + GprsAdministrator.Entity_Sign; text = text + "&entity.deviceModel=" + pModel; text = text + "&entity.originalUserId=" + pUserId; text = text + "&entity.terminalCode=" + pDeviceID + GprsAdministrator.GetTimeStamp(); string webClient = GprsAdministrator.GetWebClient(text); JArray jArray = GprsAdministrator.Json2JArray(webClient); GprsAdministrator.Message = jArray[0]["message"].ToString(); if (jArray[0]["success"].ToObject <bool>()) { JArray jArray2 = GprsAdministrator.Json2JArray(jArray[0]["entity"].ToString()); GprsAdministrator.laseDeviceID = jArray2[0]["id"].ToString(); return(true); } return(false); }
public static JArray API_GetUserDeviceList() { string text = formMain.GprsServer + "terminal/listByUser.json?"; text = text + "user.id=" + GprsAdministrator.Entity_ID; text = text + "&user.userType=" + GprsAdministrator.Entity_UserType; text = text + "&user.username="******"&user.sign=" + GprsAdministrator.Entity_Sign + GprsAdministrator.GetTimeStamp(); text += "&Rows=99999"; string webClient = GprsAdministrator.GetWebClient(text); if (webClient == "") { return(null); } JArray jArray = GprsAdministrator.Json2JArray(webClient); GprsAdministrator.Message = jArray[0]["message"].ToString(); if (jArray[0]["success"].ToObject <bool>()) { return(GprsAdministrator.Json2JArray(jArray[0]["entities"].ToString())); } return(null); }
public static bool API_UserBindNewDevice(string pUserName, string pPassword) { string url = formMain.GprsServer + "terminal/bindToUserFromUser.json"; string text = "user.id=" + GprsAdministrator.Entity_ID; text = text + "&user.userType=" + GprsAdministrator.Entity_UserType; text = text + "&user.username="******"&user.sign=", GprsAdministrator.Entity_Sign, "&Time=", GprsAdministrator.GetTimeStamp() }); text = text + "&sourceUsername="******"&sourcePassword="******"success"].ToObject <bool>()); }