public DataTable UpdateMobile(int Id, string Mobile, string Model, int Price, string Description) { MobileAccess mobileAccess = new MobileAccess(); DataTable dtresult = mobileAccess.UpdateMobile(Id, Mobile, Model, Price, Description); return(dtresult); }
/// <summary> /// 获取用户信息 /// </summary> /// <param name="userCode"></param> /// <param name="mobileToken"></param> /// <param name="targetUserId"></param> public JsonResult GetUserByObjectID(string userCode, string targetUserId) { return(ExecuteFunctionRun(() => { OThinker.Organization.User user = this.Engine.Organization.GetUnit(targetUserId) as OThinker.Organization.User; if (user == null) { Json("", JsonRequestBehavior.AllowGet); } ; UserValidator userValidator = UserValidatorFactory.GetUserValidator(this.Engine, user.Code); MobileAccess mobile = new MobileAccess(); MobileAccess.MobileUser mobileUser = mobile.GetMobileUser(this.UserValidator, user, userValidator.ImagePath, userValidator.DepartmentName, string.Empty); var result = new { MobileUser = mobileUser }; return Json(result, JsonRequestBehavior.AllowGet); })); }
public DataTable DeleteAllMobiles() { MobileAccess mobileAccess = new MobileAccess(); DataTable dtresult = mobileAccess.DeleteAllMobiles(); return(dtresult); }
public JsonResult LoadInstances(string userId, string mobileToken, string keyWord, DateTime?lastTime, string sortKey, string sortDirection) { return(ExecuteFunctionRun(() => { if (userId.IndexOf("'") > -1 || userId.IndexOf("--") > -1) { Json("", JsonRequestBehavior.AllowGet); } ; if (keyWord.IndexOf("'") > -1 || keyWord.IndexOf("--") > -1) { Json("", JsonRequestBehavior.AllowGet); } ; MobileAccess mobile = new MobileAccess(); var result = mobile.LoadInstances(userId, mobileToken, keyWord, lastTime == null ? DateTime.MinValue : lastTime.Value, sortKey, sortDirection); if (result == null) { Json("", JsonRequestBehavior.AllowGet); } ; return Json(result, JsonRequestBehavior.AllowGet); })); }
public DataTable SelectAllMobiles() { MobileAccess mobileAccess = new MobileAccess(); DataTable dtresult = mobileAccess.SelectAllMobiles(); return(dtresult); }
public DataTable SelectMobileById(int Id) { MobileAccess mobileAccess = new MobileAccess(); DataTable dtresult = mobileAccess.SelectMobileById(Id); return(dtresult); }
public JsonResult ValidateLoginForDingTalkPC(string state, string code) { this.Engine.LogWriter.Write("DingTalkPC:进入登录方法-------------------------"); OThinker.Organization.User currentUser = null; UserValidator userValidator = null; string userImage = string.Empty; // 钉钉登录 IEngine engine = AppUtility.Engine; userValidator = UserValidatorFactory.LoginAsDingTalkPCAndReturnUserValidator(state, code); object result = null; if (userValidator == null) { result = new { Success = false }; } else { currentUser = userValidator.User; userImage = userValidator.ImagePath; MobileAccess mobile = new MobileAccess(); MobileAccess.MobileUser mobileUser = mobile.GetMobileUser(userValidator, currentUser, userImage, string.Empty, string.Empty); FormsAuthentication.SetAuthCookie(currentUser.Code, false); // 当前用户登录 Session[Sessions.GetUserValidator()] = userValidator; result = getCurrentUser(); } return(Json(result, JsonRequestBehavior.AllowGet)); }
public JsonResult GetUserByObjectID(string userCode, string mobileToken, string targetUserId) { UserValidator sourceUser = this.UserValidator; if (sourceUser == null) { return(Json(new { }, JsonRequestBehavior.AllowGet)); } OThinker.Organization.User user = this.Engine.Organization.GetUnit(targetUserId) as OThinker.Organization.User; if (user == null) { return(Json(new { }, JsonRequestBehavior.AllowGet)); } UserValidator userValidator = UserValidatorFactory.GetUserValidator(this.Engine, user.Code); MobileAccess mobile = new MobileAccess(); MobileAccess.MobileUser mobileUser = mobile.GetMobileUser(sourceUser, user, user.ImageUrl, userValidator.DepartmentName, string.Empty); var result = new { MobileUser = mobileUser }; return(Json(result, JsonRequestBehavior.AllowGet)); }
/// <summary> /// 微信集成登录 /// </summary> /// <param name="context"></param> public JsonResult ValidateLoginForWeChat(string state, string code) { OThinker.Organization.User currentUser = null; UserValidator userValidator = null; string userImage = string.Empty; // 微信登录 if (this.UserValidator != null) { userValidator = this.UserValidator; } else { IEngine engine = AppUtility.Engine; userValidator = UserValidatorFactory.LoginAsWeChatReturnUserValidator(state, code); } object result = null; if (userValidator == null) { result = new { Success = false, Messages = "UserNotExist" }; } else { currentUser = userValidator.User; if (currentUser == null || currentUser.State == State.Inactive || currentUser.ServiceState == UserServiceState.Dismissed || currentUser.IsVirtualUser) { result = new { Success = false, Messages = "InvalidUser" }; } userImage = userValidator.ImagePath; MobileAccess mobile = new MobileAccess(); MobileAccess.MobileUser mobileUser = mobile.GetMobileUser(userValidator, currentUser, userImage, string.Empty, string.Empty); result = new { Success = true, PortalRoot = this.PortalRoot, MobileUser = mobileUser, DirectoryUnits = GetDirectoryUnits(currentUser.ObjectID, userValidator) }; FormsAuthentication.SetAuthCookie(currentUser.Code, false); // 当前用户登录 Session[Sessions.GetUserValidator()] = userValidator; Session[Sessions.GetWeChatLogin()] = true; } return(Json(result, JsonRequestBehavior.AllowGet)); }
public JsonResult GetOrganizationByParent(string userCode, string mobileToken, string parentId) { return(ExecuteFunctionRun(() => { MobileAccess mobile = new MobileAccess(); var result = mobile.GetOrganizationByParentFn(this.UserValidator, userCode, mobileToken, parentId); return Json(result, JsonRequestBehavior.AllowGet); })); }
public JsonResult LoadInstanceState(string userId, string userCode, string mobileToken, string instanceId, string workItemId) { userId = this.UserValidator.UserID; return(ExecuteFunctionRun(() => { MobileAccess mobile = new MobileAccess(); var result = mobile.LoadInstanceState(userId, mobileToken, instanceId, this.UserValidator, workItemId); return Json(result, JsonRequestBehavior.AllowGet); })); }
public void orderInfo(ref MobileOrderInfo orderinfo, PayParam p) { try { MobileOrderParam mobileOrderParam = new MobileOrderParam(); //获取订单 log.Write("发起订单:电话号码:" + payParam.PhoneOn + ",缴费金额:" + payParam.UserInputMoney); mobileOrderParam.mobile = payParam.PhoneOn; mobileOrderParam.paymentAmout = p.userInputAmount; mobileOrderParam.shopType = PayAccess.isWtLkl(p.icParams); orderinfo = MobileAccess.order(mobileOrderParam, payParam.QueryInfo); if ("9999".Equals(orderinfo.msgrsp.retcode)) { return; } if ("1234".Equals(orderinfo.msgrsp.retcode)) { return; } if (!"0000".Equals(orderinfo.msgrsp.retcode)) { return; } //获取商户号 p.MERCHANTNO_shopNo = orderinfo.msgrsp.MERCHANTNO; //获取终端号 p.TERMINALNO_clientNo = orderinfo.msgrsp.TERMINALNO; if (PayStaticParam.payType == 0) { //交易金额 p.rechageAmount = p.userInputAmount; Payment.mobilePayParam.RechageAmount = p.userInputAmount; } else { //交易金额 p.rechageAmount = orderinfo.msgrsp.realAmout; Payment.mobilePayParam.RechageAmount = orderinfo.msgrsp.realAmout; } //交易订单号 p.orderNo = orderinfo.msgrsp.orderNo; Payment.mobilePayParam.OrderInfo = orderinfo; log.Write("订单提交成功:订单号:" + orderinfo.msgrsp.orderNo); } catch (Exception ex) { log.Write("获取缴费订单失败:" + ex.Message + Environment.NewLine + ex.InnerException); //获取订单的失败 exit("充值失败,请稍后再试..."); return; } }
public JsonResult LoadWorkflows() { return(ExecuteFunctionRun(() => { MobileAccess mobile = new MobileAccess(); var result = mobile.LoadWorkflowsFn(this.UserValidator); if (result == null) { return Json("", JsonRequestBehavior.AllowGet); } return Json(result, JsonRequestBehavior.AllowGet); })); }
/// <summary> /// 搜索用户 /// </summary> /// <param name="context"></param> public JsonResult SearchUser(string userCode, string mobileToken, string searchKey, string parentId) { return(ExecuteFunctionRun(() => { MobileAccess mobile = new MobileAccess(); var result = mobile.SearchUserFn(userCode, "", parentId, searchKey); if (result == null) { return Json("", JsonRequestBehavior.AllowGet); } ; return Json(result, JsonRequestBehavior.AllowGet); })); }
public JsonResult RefreshInstances(string userId, string mobileToken, string keyWord, DateTime?lastTime) { return(ExecuteFunctionRun(() => { if (userId.IndexOf("'") > -1 || userId.IndexOf("--") > -1) { return Json("", JsonRequestBehavior.AllowGet); } MobileAccess mobile = new MobileAccess(); var result = mobile.RefreshInstances(userId, mobileToken, keyWord, lastTime == null ? DateTime.MinValue : lastTime.Value); if (result == null) { return Json("", JsonRequestBehavior.AllowGet); } return Json(result, JsonRequestBehavior.AllowGet); })); }
/// <summary> /// 钉钉集成登录 /// </summary> /// <param name="state">引擎编码</param> /// <param name="code">临时授权码</param> public JsonResult ValidateLoginForDingTalk(string state, string code) { return(ExecutionActionWithLog("DingTalkController.ValidateLoginForDingTalk", () => { OThinker.Organization.User currentUser = null; UserValidator userValidator = null; string userImage = string.Empty; // 钉钉登录 IEngine engine = AppUtility.Engine; userValidator = UserValidatorFactory.LoginAsDingTalkReturnUserValidator(state, code); object result = null; if (userValidator == null) { result = new { Success = false }; } else { currentUser = userValidator.User; userImage = userValidator.ImagePath; MobileAccess mobile = new MobileAccess(); MobileAccess.MobileUser mobileUser = mobile.GetMobileUser(userValidator, currentUser, userImage, string.Empty, string.Empty); result = new { Success = true, PortalRoot = this.PortalRoot, MobileUser = mobileUser, DirectoryUnits = GetDirectoryUnits(mobileUser.ObjectID, userValidator) }; FormsAuthentication.SetAuthCookie(currentUser.Code, false); // 当前用户登录 Session[Sessions.GetUserValidator()] = userValidator; Session[Sessions.GetDingTalkLogin()] = true; } return Json(result, JsonRequestBehavior.AllowGet); })); }
/// <summary> /// 刷新用户的待办任务 /// </summary> /// <param name="userId">用户ID</param> /// <param name="mobileToken">用户身份</param> /// <param name="keyWord">查询关键字</param> /// <param name="lastTime">最后刷新时间</param> /// <param name="finishedWorkItem">是否加载已办任务</param> /// <param name="existsLength">返回待办任务ID的数量</param> public JsonResult RefreshWorkItem(string userId, string mobileToken, string keyWord, DateTime?lastTime, bool finishedWorkItem, int existsLength) { return(ExecuteFunctionRun(() => { existsLength = int.Parse(existsLength + string.Empty == "" ? "0" : existsLength + string.Empty); if (userId.IndexOf("'") > -1 || userId.IndexOf("--") > -1) { return Json("", JsonRequestBehavior.AllowGet); } ; MobileAccess mobile = new MobileAccess(); var result = mobile.RefreshWorkItem(userId, mobileToken, keyWord, lastTime == null ? DateTime.MinValue : lastTime.Value, finishedWorkItem, existsLength); if (result == null) { return Json("", JsonRequestBehavior.AllowGet); } ; return Json(result, JsonRequestBehavior.AllowGet); })); }
//查询 private void query() { try { //显示图片 this.loadlbl.Dispatcher.Invoke(new isShowLableDelegate(isShowLable), this.loadlbl, true); MobileQueryInfo info = MobileAccess.query(Payment.mobilePayParam.PhoneOn); if (!"0000".Equals(info.msgrsp.retcode)) { if (info.msgrsp.retshow.Length > 0) { this.showInfoTxt.Dispatcher.Invoke(new showInfoDelegate(setShowInfo), info.msgrsp.retshow); return; } else { this.showInfoTxt.Dispatcher.Invoke(new showInfoDelegate(setShowInfo), "查询失败,请稍后再试"); return; } } Payment.mobilePayParam.QueryInfo = info; //格式金额,小数 double amout = 0; double price = 0; amout = Convert.ToDouble(info.msgrsp.prepaidBalance); price = Convert.ToDouble(info.msgrsp.payableAmout); amout = amout / 100; price = price / 100; //显示电话号码 this.lblBalance.Dispatcher.Invoke(new balanceDelegate(setBalanceText), Payment.mobilePayParam.PhoneOn); //显示余额 this.lblAmount.Dispatcher.Invoke(new amountDelegate(setAmountText), amout.ToString()); //显示欠费金额 this.overdueMoneyLbl.Dispatcher.Invoke(new overdueMoneyDelegate(setOverdueMoneyText), price.ToString()); //显示面板 panel.Dispatcher.Invoke(new panelShowDelegate(setPanelVisibility), true); //显示充值按钮 this.OkBtn.Dispatcher.Invoke(new isShowBtnDelegate(setBtnVisibility), OkBtn, true); //提示信息 this.showInfoTxt.Dispatcher.Invoke(new showInfoDelegate(setShowInfo), "您的话费信息"); SysBLL.Player("继续缴费请点击确定按钮.wav"); } catch (ThreadAbortException ae) { log.Write("error:" + ae.Message); } catch (WtException wte) { //异常处理 if (wte.getCode() == WtExceptionCode.Sys.NETWORK) { this.showInfoTxt.Dispatcher.Invoke(new showInfoDelegate(setShowInfo), WtException.formatMsg(WtExceptionCode.Sys.NETWORK) + wte.Message); } else { this.showInfoTxt.Dispatcher.Invoke(new showInfoDelegate(setShowInfo), WtException.formatMsg(WtExceptionCode.Bus.BUS_QUERY) + wte.Message); } } catch (Exception e) { this.showInfoTxt.Dispatcher.Invoke(new showInfoDelegate(setShowInfo), "查询失败,请稍后再试"); log.Write("error:FormMobileStep02:query():" + e.Message); } finally { //隐藏加载图片 this.loadlbl.Dispatcher.Invoke(new isShowLableDelegate(isShowLable), this.loadlbl, false); } }