void OnLoginReceived(OperationResponse response) { Debug.Log("[OnLoginReceived]"); switch ((NextAction)response.ReturnCode) { case NextAction.LoginSuccess: byte[] bytes = (byte[])DictionaryTool.GetValue <byte, object> (response.Parameters, 1); ProtoData.UserData data = BinSerializer.Deserialize <ProtoData.UserData> (bytes); GameManager.Instance.Join(data.nickname, (Race)data.race); TransitionManager.Instance.OnSceneTransition(SceneName.GetMainLobby((Race)data.race), TransitionType.Loading01_Slide, null); break; case NextAction.LoginFailed: BasePage.OnMessageBox("로그인에 실패하셨습니다.", true, null, "확인"); break; case NextAction.UserCreateFail: BasePage.OnMessageBox("ID길이가 잘못 되었습니다.\n(2글자 ~ 10글자)", true, null, "확인"); break; case NextAction.UserInfoCreate: Action action = () => { LoginGameMode gameMode = GameManager.Instance.GameMode as LoginGameMode; GameManager.Instance.GameMode.CurrentPage = gameMode.cutScenePage; }; TransitionManager.Instance.OnTransition(TransitionType.Blank, TransitionType.Slide, action, null); break; } }
void OnUserResistrationReceived(OperationResponse response) { Debug.Log("[OnUserResistrationReceived]"); ReturnCode rc = (ReturnCode)response.ReturnCode; if (rc == ReturnCode.Success) { byte[] bytes = (byte[])DictionaryTool.GetValue <byte, object> (response.Parameters, 1); ProtoData.UserData data = BinSerializer.Deserialize <ProtoData.UserData> (bytes); GameManager.Instance.Join(data.nickname, (Race)data.race); TransitionManager.Instance.OnSceneTransition(SceneName.GetMainLobby(GameManager.Instance.LocalPlayer.playerInfo.Race), TransitionType.Loading01_Slide, null); } else { BasePage.OnMessageBox("닉네임의 길이가 잘못 되었습니다.\n(3글자 ~ 6글자)", true, null, "확인"); } }
protected void Page_Load(object sender, EventArgs e) { //用户ID var codeUser = Request.Params["CodeUser"]; //应用名称 var appName = Request.Params["AppName"]; Dictionary <string, Array> info = new Dictionary <string, Array>(); try { if (codeUser == null || appName == null) { string[] arry0 = new string[1]; arry0[0] = "举例:http://218.92.115.55/MobilePlatform/UserPermission/GetUserPermissions.aspx?CodeUser=121907&AppName=ZSLB"; info.Add("参加CodeUser,AppName不能为null!", arry0); Json = JsonConvert.SerializeObject(info); return; } //获取应用名称对应的iport数据库构建注册项目---对应的code_assembly string codeAssembly = DictionaryTool.GetCodeAssembly(appName.ToUpper()); //获取用户一级界面权限 string sql = string.Format("select key from vw_userpermission where isenable=1 and supertype=1 and code_user='******' and code_assembly='{1}' order by code_sort", codeUser, codeAssembly); var dt1 = new Leo.Oracle.DataAccess(RegistryKey.KeyPathIport).ExecuteTable(sql); if (dt1.Rows.Count == 0) { string[] arry0 = new string[1]; arry0[0] = "No"; info.Add("IsGet", arry0); string[] arry1 = new string[1]; arry1[0] = "网络错误,请稍后再试!"; info.Add("Message", arry1); Json = JsonConvert.SerializeObject(info); return; } string[] key1Arry = new string[dt1.Rows.Count]; //获取用户二级界面权限 for (int iRow = 0; iRow < dt1.Rows.Count; iRow++) { string key1 = Convert.ToString(dt1.Rows[iRow]["key"]); key1Arry[iRow] = key1; sql = string.Format("select key from vw_userpermission where isenable=1 and supertype=2 and code_user='******' and code_assembly='{1}' and superkey='{2}' order by code_sort", codeUser, codeAssembly, key1); var dt2 = new Leo.Oracle.DataAccess(RegistryKey.KeyPathIport).ExecuteTable(sql); string[] key2Arry = new string[dt2.Rows.Count]; for (int jRow = 0; jRow < dt2.Rows.Count; jRow++) { key2Arry[jRow] = Convert.ToString(dt2.Rows[jRow]["key"]); } info.Add(key1, key2Arry); } info.Add("Order", key1Arry); Json = JsonConvert.SerializeObject(info); } catch (Exception ex) { string[] arry0 = new string[1]; arry0[0] = "No"; info.Add("IsGet", arry0); string[] arry1 = new string[1]; arry1[0] = ex.Message; info.Add("Message", arry1); Json = JsonConvert.SerializeObject(info); return; } }
protected void Page_Load(object sender, EventArgs e) { //应用名称 var appName = Request.Params["AppName"]; //用户名筛选 var filter = Request.Params["Filter"]; Dictionary <string, Array> info = new Dictionary <string, Array>(); try { if (appName == null) { string[] arry0 = new string[1]; arry0[0] = "http://218.92.115.55/MobilePlatform/Contacts/GetPerContactList.aspx?AppName=WLKG&filter="; info.Add("参数AppName,Filter不能为null", arry0); Json = JsonConvert.SerializeObject(info); return; } //获取App应用对应的公司,公司对应的内部网公司ID string nbwCompanyId = DictionaryTool.GetNbwCompanyId(appName.ToUpper()); if (nbwCompanyId == string.Empty) { return; } string sql; if (string.IsNullOrEmpty(filter) || string.IsNullOrWhiteSpace(filter)) { sql = string.Format( "select t.user_id,t.login_name,t.user_name,t.tel,t.email,t.company_id,t.company_name,t.dept_id,t.tel1,t.duty,t.tel2,t.pemail,t.phone1,t.head_pic from VW_SYS_USER t where t.company_id='{0}' order by t.user_name", nbwCompanyId); } else { sql = string.Format( "select t.user_id,t.login_name,t.user_name,t.tel,t.email,t.company_id,t.company_name,t.dept_id,t.tel1,t.duty,t.tel2,t.pemail,t.phone1,t.head_pic from VW_SYS_USER t where t.company_id='{0}' and t.user_name like '%{1}%' order by t.user_name", nbwCompanyId, filter); } var dt = new Leo.Oracle.DataAccess(RegistryKey.KeyPathMa).ExecuteTable(sql); string[,] arrys = new string[dt.Rows.Count, 4]; for (int iRow = 0; iRow < dt.Rows.Count; iRow++) { arrys[iRow, 0] = Convert.ToString(dt.Rows[iRow]["user_id"]); arrys[iRow, 1] = Convert.ToString(dt.Rows[iRow]["user_name"]); arrys[iRow, 2] = Convert.ToString(dt.Rows[iRow]["tel1"]); arrys[iRow, 3] = Convert.ToString(dt.Rows[iRow]["email"]); } string[] arry2 = new string[1]; arry2[0] = "Yes"; info.Add("IsGet", arry2); info.Add("PerContactList", arrys); Json = JsonConvert.SerializeObject(info); } catch (Exception ex) { string[] arry0 = new string[1]; arry0[0] = "NO"; info.Add("IsGet", arry0); string[] arry1 = new string[1]; arry1[0] = ex.Message; info.Add("Message", arry1); Json = JsonConvert.SerializeObject(info); } }
protected void Page_Load(object sender, EventArgs e) { var Logogram = Request.Params["Logogram"]; var Password = Request.Params["Password"]; var DeviceToken = Request.Params["DeviceToken"]; var DeviceType = Request.Params["DeviceType"]; var AppName = Request.Params["AppName"]; Dictionary <string, string> info = new Dictionary <string, string>(); try { if (Logogram == null || Password == null || DeviceToken == null || DeviceType == null || AppName == null) { info.Add("参数Logogram,Password,DeviceToken,DeviceType,AppName不能为空!", "举例:http://218.92.115.55/MobilePlatform/Login.aspx?Logogram=zhangsan&Password=123&DeviceToken=aaaaaa&DeviceType=iOS&AppName=HMW"); Json = JsonConvert.SerializeObject(info); return; } //获取应用名称对应的用户类型 string UserType = DictionaryTool.GetUserType(AppName.ToUpper()); if (UserType == string.Empty) { return; } string Code_User; string Code_Company; string Code_Department; string UserName; string Mobile = string.Empty; //string Department; if (UserType == "nbw") { string sql = string.Format("select * from USER_INFO where username='******'", Logogram); var dt = new Leo.Oracle.DataAccess(RegistryKey.KeyPathNbw).ExecuteTable(sql); if (dt.Rows.Count == 0) { info.Add("IsLogin", "No"); info.Add("Message", "用户名错误!"); Json = JsonConvert.SerializeObject(info); return; } if (Password == dt.Rows[0]["PASSWORD"] as string) { info.Add("IsLogin", "No"); info.Add("Message", "密码错误!"); Json = JsonConvert.SerializeObject(info); return; } Code_User = dt.Rows[0]["GONGHAO"] as string; Code_Company = dt.Rows[0]["Code_Company"] as string; Code_Department = dt.Rows[0]["Code_Department"] as string; UserName = dt.Rows[0]["TrueName"] as string; //Department = dt.Rows[0]["Duty"] as string; } else if (UserType == "iPort") { //获取应用名称与Iport关键字对应字典表 string iportKeyDataBase = DictionaryTool.GetIportKeyDataBase(AppName.ToUpper()); string sql = string.Format(@"select a.code_user,a.code_company,a.code_department,a.username,a.password,b.mobile from TB_SYS_USER a,TB_SYS_USERINFO b where a.code_user=b.code_user(+) and upper(logogram)='{0}' and mark_audit='1'", Logogram.ToUpper()); var dt = new Leo.Oracle.DataAccess(iportKeyDataBase).ExecuteTable(sql); if (dt.Rows.Count <= 0) { info.Add("IsLogin", "No"); info.Add("Message", "用户名错误!"); Json = JsonConvert.SerializeObject(info); return; } if (!Identity.VerifyText(Format.Trim(Password), dt.Rows[0]["PASSWORD"] as string)) { info.Add("IsLogin", "No"); info.Add("Message", "密码错误!"); Json = JsonConvert.SerializeObject(info); return; } Code_User = dt.Rows[0]["Code_User"] as string; Code_Company = dt.Rows[0]["Code_Company"] as string; Code_Department = dt.Rows[0]["Code_Department"] as string; UserName = dt.Rows[0]["UserName"] as string; Mobile = dt.Rows[0]["Mobile"] as string; //Department = dt.Rows[0]["Duty"] as string; } else { return; } Mobile = (Mobile == null ? "" : Mobile); //获取应用名称与移动设备关键字对应字典表 string deviceKeyDataBase = DictionaryTool.GetDeviceKeyDataBase(AppName.ToUpper()); string sql1 = string.Format("select * from tb_app_device where mobile='{0}' and appname='{1}'", Mobile, AppName); var dt1 = new Leo.Oracle.DataAccess(deviceKeyDataBase).ExecuteTable(sql1); string isBinding = "0"; if (dt1.Rows.Count == 0) { //sql1 = string.Format("insert into tb_app_device (mobile,devicetoken,devicetype,appname) values ('{0}','{1}','{2}','{3}',to_date('{4}','YYYY-MM-DD HH24:MI:SS'))", Mobile, DeviceToken, DeviceType, AppName); //dt1 = new Leo.Oracle.DataAccess(RegistryKey.KeyPathMa).ExecuteTable(sql1); //isBinding = "0"; } else { if ("1" == Convert.ToString(dt1.Rows[0]["isbinding"])) { if (DeviceToken != dt1.Rows[0]["DEVICETOKEN"] as string) { info.Add("IsLogin", "No"); info.Add("Error", "登录失败,已绑定到其他设备!"); Json = JsonConvert.SerializeObject(info); return; } } isBinding = Convert.ToString(dt1.Rows[0]["isbinding"]); } info.Add("IsLogin", "Yes"); info.Add("Code_User", Code_User); info.Add("Code_Department", Code_Department); info.Add("Code_Company", Code_Company); info.Add("UserName", UserName); info.Add("IsBinding", isBinding); Json = JsonConvert.SerializeObject(info); } catch (Exception ex) { info.Add("IsLogin", "No"); info.Add("Message", ex.Message); Json = JsonConvert.SerializeObject(info); } }
protected void Page_Load(object sender, EventArgs e) { //应用名称 var appName = Request.Params["AppName"]; try { if (appName == null) { string warning = "参数AppName不能为null!举例:http://218.92.115.55/MobilePlatform/Contacts/GetPersonContactList.aspx?AppName=WLKG"; Json = JsonConvert.SerializeObject(warning); return; } //获取App应用对应的公司,公司对应的内部网公司ID string nbwCompanyId = DictionaryTool.GetNbwCompanyId(appName.ToUpper()); if (nbwCompanyId == string.Empty) { string warning = "应用名称错误!"; Json = JsonConvert.SerializeObject(warning); return; } string sql = string.Format("select code,Description from gpms2000_nbw..department_sr"); var dt0 = new Leo.SqlServer.DataAccess(RegistryKey.KeyPathNbwDept).ExecuteTable(sql); if (dt0.Rows.Count == 0) { string error = "网络错误,请稍后再试!"; Json = JsonConvert.SerializeObject(error); return; } sql = string.Format( "select a.id,a.username as login_name,a.truename as user_name,a.tel,a.email,a.companyid as company_id,b.shortname as company_name,a.bumenid as dept_id,a.tel1,a.duty,a.tel2,a.pemail,a.phone1,a.head_pic from user_info a, company_name b where a.companyid='{0}' and substr(a.bumenid,1,4)=b.companyid order by user_name", nbwCompanyId); var dt1 = new Leo.Oracle.DataAccess(RegistryKey.KeyPathNbw).ExecuteTable(sql); var infoArray = new List <Dictionary <string, string> >(); for (int iRow = 0; iRow < dt1.Rows.Count; iRow++) { string departmentName = ""; bool markWeibo = true; var rows = dt0.Select(string.Format("CODE='{0}'", Convert.ToString(dt1.Rows[iRow]["dept_id"]))); if (rows.Length > 0) { departmentName = rows[0]["DESCRIPTION"] as string; } departmentName = departmentName == null ? string.Empty : departmentName; markWeibo = !(dt1.Rows[iRow]["EMAIL"] is DBNull) && !string.IsNullOrEmpty(dt1.Rows[iRow]["EMAIL"] as string) && !string.IsNullOrWhiteSpace(dt1.Rows[iRow]["EMAIL"] as string); Dictionary <string, string> info = new Dictionary <string, string>(); info.Add("userID", Convert.ToString(dt1.Rows[iRow]["ID"])); info.Add("name", Convert.ToString(dt1.Rows[iRow]["USER_NAME"])); info.Add("company", Convert.ToString(dt1.Rows[iRow]["COMPANY_NAME"])); info.Add("department", departmentName); info.Add("duty", Convert.ToString(dt1.Rows[iRow]["DUTY"])); info.Add("mobilephone", Convert.ToString(dt1.Rows[iRow]["TEL"])); info.Add("backupmobilephone", Convert.ToString(dt1.Rows[iRow]["PHONE1"])); info.Add("telephone", Convert.ToString(dt1.Rows[iRow]["TEL1"])); info.Add("backuptelephone", Convert.ToString(dt1.Rows[iRow]["TEL2"])); info.Add("workemail", Convert.ToString(dt1.Rows[iRow]["EMAIL"])); info.Add("personalemail", Convert.ToString(dt1.Rows[iRow]["PEMAIL"])); info.Add("weibo", markWeibo == true ? "已开通" : "未开通"); infoArray.Add(info); } Json = JsonConvert.SerializeObject(infoArray); } catch (Exception ex) { Json = JsonConvert.SerializeObject(ex.Message); } }