public string Execute(Hashtable params_ht) { Hashtable res = params_ht; if (res["UID"] == null || res["UID"].ToString().Trim().Length <= 0 || res["PushID"] == null || res["PushID"].ToString().Trim().Length <= 0) { return(SiteHelper.GetJsonFromHashTable(null, "faild", "参数不完整")); } else { uid = res["UID"].ToString().Trim(); pushid = res["PushID"].ToString().Trim(); OPUserManager userManager = new OPUserManager(); Hashtable user = userManager.GetUserInfoByUserID(uid); if (user == null || user.Keys.Count <= 0) { return(SiteHelper.GetJsonFromHashTable(null, "faild", "用户不存在")); } else { Hashtable modifyUser = new Hashtable(); modifyUser["PushID"] = pushid; bool issuccess = userManager.AddOrEditUserInfo(modifyUser, uid); if (!issuccess) { return(SiteHelper.GetJsonFromHashTable(null, "faild", "保存失败")); } } return(SiteHelper.GetJsonFromHashTable(null, "success", "保存成功", "SetPushInfo")); } }
public string Execute(Hashtable params_ht) { Hashtable res = params_ht; if (res["UID"] == null || res["Content"] == null || res["UID"].ToString().Trim().Length <= 0 || res["Content"].ToString().Trim().Length <= 0) { return(SiteHelper.GetJsonFromHashTable(null, "faild", "参数不完整")); } else { try { uid = res["UID"].ToString().Trim(); content = res["Content"].ToString().Trim(); } catch { return(SiteHelper.GetJsonFromHashTable(null, "faild", "数据格式不正确")); } string userName = ""; OPUserManager hum = new OPUserManager(); Hashtable user_ht = hum.GetUserInfoByUserID(uid); if (user_ht != null && user_ht.Count > 0) { userName = user_ht["USERNAME"].ToString(); } Hashtable ht = new Hashtable(); ht["ID"] = CommonHelper.GetGuid; ht["Content"] = content; ht["UserID"] = uid; ht["UserName"] = userName; ht["AppID"] = "002"; ht["AppName"] = "运维app"; ht["ReadFlag"] = 0; FeedbackManager fm = new FeedbackManager(); bool isSuccess = fm.AddFeedback(ht); if (isSuccess) { return(SiteHelper.GetJsonFromHashTable(null, "success", "意见反馈成功")); } else { return(SiteHelper.GetJsonFromHashTable(null, "faild", "意见反馈失败")); } } }
/// <summary> /// 初始化 /// </summary> private void InitData() { Hashtable ht = userManager.GetUserInfoByUserID(_key); if (ht != null && ht.Keys.Count > 0) { ControlBindHelper.SetWebControls(this.Page, ht); DataTable list = userManager.GetUserParkingList(_key); foreach (DataRow dr in list.Rows) { ParkingList.Items.FindByValue(dr["ID"].ToString()).Selected = true; } } }
public string Execute(Hashtable params_ht) { Hashtable res = params_ht; if (res["SetType"] == null || res["Content"] == null || res["UID"] == null || res["SetType"].ToString().Trim().Length <= 0 || res["Content"].ToString().Trim().Length <= 0 || res["UID"].ToString().Trim().Length <= 0) { return(SiteHelper.GetJsonFromHashTable(null, "faild", "参数不完整")); } else { OPUserManager userManager = new OPUserManager(); //1:头像,2:昵称,3:性别,4:电子邮箱 uid = res["UID"].ToString().Trim(); setType = res["SetType"].ToString().Trim(); content = res["Content"].ToString().Trim(); Hashtable user = userManager.GetUserInfoByUserID(uid); if (user == null || user.Keys.Count <= 0) { return(SiteHelper.GetJsonFromHashTable(null, "faild", "用户不存在")); } else { if (setType == "1") { //修改头像 try { string imgPath = BitmapHelper.toUpload(content); Hashtable modifyUser = new Hashtable(); modifyUser["HeadPortrait"] = imgPath; bool issuccess = userManager.AddOrEditUserInfo(modifyUser, uid); if (!issuccess) { return(SiteHelper.GetJsonFromHashTable(null, "faild", "用户头像保存失败")); } else { user["HeadPortrait"] = imgPath; } } catch (Exception e1) { return(SiteHelper.GetJsonFromHashTable(null, "faild", "用户头像保存失败")); } } else if (setType == "2") { //修改姓名 Hashtable modifyUser = new Hashtable(); modifyUser["NickName"] = content; bool issuccess = userManager.AddOrEditUserInfo(modifyUser, uid); if (!issuccess) { return(SiteHelper.GetJsonFromHashTable(null, "faild", "昵称保存失败")); } else { user["NickName"] = content; } } else if (setType == "3") { //修改昵称 Hashtable modifyUser = new Hashtable(); modifyUser["UserSex"] = content; bool issuccess = userManager.AddOrEditUserInfo(modifyUser, uid); if (!issuccess) { return(SiteHelper.GetJsonFromHashTable(null, "faild", "性别保存失败")); } else { user["UserSex"] = content; } } else if (setType == "4") { //修改邮箱 Hashtable modifyUser = new Hashtable(); modifyUser["Email"] = content; bool issuccess = userManager.AddOrEditUserInfo(modifyUser, uid); if (!issuccess) { return(SiteHelper.GetJsonFromHashTable(null, "faild", "电子邮箱保存失败")); } else { user["Email"] = content; } } else { return(SiteHelper.GetJsonFromHashTable(null, "faild", "修改项不合法")); } } DataTable dt = userManager.GetUserInfoByMobile(SiteHelper.GetHashTableValueByKey(user, "Tel")); if (dt == null || dt.Rows.Count <= 0) { return(SiteHelper.GetJsonFromHashTable(null, "faild", "网络异常")); } else { Hashtable huser = DataTableHelper.DataRowToHashTable(dt.Rows[0]); return(SiteHelper.GetJsonFromHashTable(huser, "success", "操作成功", "UserInfo")); } } }
public string Execute(Hashtable params_ht) { Hashtable res = params_ht; if (res["UID"] == null || res["VehicleID"] == null || res["FaultType"] == null || res["UID"].ToString().Trim().Length <= 0 || res["VehicleID"].ToString().Trim().Length <= 0 || res["FaultType"].ToString().Trim().Length <= 0) { return(SiteHelper.GetJsonFromHashTable(null, "faild", "参数不完整")); } else { try { uid = res["UID"].ToString().Trim(); vehicleid = res["VehicleID"].ToString().Trim(); faulttype = res["FaultType"].ToString().Trim(); if (res["Images"] != null) { images = res["Images"].ToString().Trim(); } } catch { return(SiteHelper.GetJsonFromHashTable(null, "faild", "数据格式不正确")); } VehicleManager vm = new VehicleManager(); OPUserManager userManager = new OPUserManager(); Hashtable vehicle_ht = vm.GetVehicleInfoByID(vehicleid); if (vehicle_ht == null || vehicle_ht.Keys.Count == 0) { return(SiteHelper.GetJsonFromHashTable(null, "faild", "未找到车辆信息,故障报修提交失败")); } Hashtable user_ht = userManager.GetUserInfoByUserID(uid); string path = SiteHelper.GetAppsetString("OtherImage"); string FaultImages = ""; if (!string.IsNullOrEmpty(images)) { string[] datas = images.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries); if (datas.Length > maxImageNum) { return(SiteHelper.GetJsonFromHashTable(null, "faild", "报修图片数量过多,最多可上传" + maxImageNum + "张图片")); } foreach (string data in datas) { string imgPath = BitmapHelper.toUpload(data); FaultImages += imgPath + ";"; } if (FaultImages.Length > 0) { FaultImages = FaultImages.Substring(0, FaultImages.Length - 1); } } Hashtable vehiclefault = new Hashtable(); vehiclefault["ID"] = CommonHelper.GetGuid; vehiclefault["VehicleName"] = SiteHelper.GetHashTableValueByKey(vehicle_ht, "LicenseNumber"); vehiclefault["SubmitUserID"] = uid; vehiclefault["SubmitUserName"] = SiteHelper.GetHashTableValueByKey(user_ht, "UserName");; vehiclefault["TriggerType"] = (int)VehicleFaultTriggerType.User; vehiclefault["FaultType"] = faulttype; vehiclefault["Remark"] = ""; vehiclefault["FaultDoState"] = (int)VehicleFaultDoState.Undisposed; vehiclefault["CreateTime"] = SiteHelper.GetWebServerCurrentTime().ToString(); if (FaultImages.Length > 0) { vehiclefault["FaultImages"] = FaultImages; } VehicleFaultManager vfm = new VehicleFaultManager(); bool isSuccess = vfm.AddOrEditVehicleFaultInfo(vehiclefault, null); if (isSuccess) { return(SiteHelper.GetJsonFromHashTable(null, "success", "故障报修提交成功")); } else { return(SiteHelper.GetJsonFromHashTable(null, "faild", "故障报修提交失败")); } } }