public ActionResult DoUnBind(string t) { MemberModel member = BaseZdBiz.Load <MemberModel>(this.getAuthMember().id); string tName = ""; if (t == "weibo") { tName = "新浪微博"; member.weiboUid = string.Empty; } else if (t == "renren") { tName = "人人网"; member.renrenUid = string.Empty; } else if (t == "kaixin") { tName = "开心网"; member.kaixinUid = string.Empty; } BaseZdBiz.Update(member, ""); WebUtil.SetSessionAttr(typeof(MemberModel).Name, member); this.SetResult(JsResultObject.CODE_ALERT, string.Format("成功解除与{0}的绑定", tName), true); return(View("Edit")); }
public ActionResult DoCancelRebate(string remark) { MemberModel member = BaseZdBiz.Load <MemberModel>(this.getAuthMember().id); DataBiz dataBiz = DataBiz.GetInstant(); /* * MemberRewardLogModel rewardLog = new MemberRewardLogModel(); * rewardLog.memberFk = member.id; * rewardLog.remark = remark; * rewardLog.moblie = moblie; * rewardLog.exchangeType = exchangeType; * rewardLog.exchangeStatus = MemberRewardLogModel.EXCHANGE_STATUS_UNEXCHANGE; * rewardLog.setPk(rewardLog.createPk()); * rewardLog.amount = dataBiz.getMemberCurAmount(member); * rewardLog.createDate = DateTime.Now; * */ member.rebateInd = BaseModel.IND_N; JsResultObject re = BaseZdBiz.Update(member, ""); if (re.code == JsResultObject.CODE_SUCCESS) { this.SetResult(JsResultObject.CODE_ALERT, "兑换请求已取消,欢迎随时申请兑换", true); } else { this.SetResult(JsResultObject.CODE_ALERT, "兑换取消失败", true); } return(Redirect(this.getPreUrl())); }
public ActionResult DoDeal(int id) { OrderModel order = BaseZdBiz.Load <OrderModel>(id); DataBiz dataBiz = DataBiz.GetInstant(); JsResultObject re = new JsResultObject(); if (StringUtil.IsIn(order.orderStatus, new string[] { OrderModel.ORDER_STATUS_COMMENTED, OrderModel.ORDER_STATUS_DEAL, OrderModel.ORDER_STATUS_CANCEL })) { re.code = JsResultObject.CODE_ERROR; re.msg = string.Format("订单{0} 状态为 {1},不能取消" , order.id , OrderModel.GetDictOrderStatus()[order.orderStatus] ); } else { order.orderStatus = OrderModel.ORDER_STATUS_DEAL; re = BaseZdBiz.Update(order, ""); if (re.code == JsResultObject.CODE_SUCCESS) { re.title = "订单处理成功"; re.msg = string.Format("订单:{0} 成交完成", id); } else { re.title = "订单处理失败"; } } return(JsonText(re, JsonRequestBehavior.AllowGet)); }
public ActionResult DoLogin(string key, string t, string uid) { MemberModel member = WebUtil.Eval(new MemberModel(), "", ""); PublicBiz publicBiz = PublicBiz.GetInstant(); JsResultObject re = publicBiz.login(member, key); if (re.code == JsResultObject.CODE_SUCCESS) { member = re.attrs[typeof(MemberModel).Name] as MemberModel; Session[typeof(MemberModel).Name] = member; OrderModel order = WebUtil.GetSessionAttr <OrderModel>(typeof(OrderModel).Name); if (order != null) { order = BaseZdBiz.Load <OrderModel>(order.id); order.memberFk = member.id; BaseZdBiz.Update(order, ""); WebUtil.SetSessionAttr(typeof(OrderModel).Name, null); } if (!string.IsNullOrEmpty(t) && !string.IsNullOrEmpty(uid)) { MemberModel m = BaseZdBiz.Load <MemberModel>(member.id); string tName = ""; if (t == "weibo") { tName = "新浪微博"; m.weiboUid = uid; } else if (t == "renren") { tName = "人人网"; m.renrenUid = uid; } else if (t == "kaixin") { tName = "开心网"; m.kaixinUid = uid; } re = BaseZdBiz.Update(m, ""); m.pwd = ""; if (re.code == JsResultObject.CODE_SUCCESS) { this.SetResult(JsResultObject.CODE_ALERT, string.Format("当前帐号已和你的{1}帐号:{0}已绑定成功,以后可以直接使用新浪微博进行登录", uid, tName), true); WebUtil.SetSessionAttr(typeof(MemberModel).Name, m); } else { this.SetResult(JsResultObject.CODE_ALERT, string.Format("当前帐号已和你的{1}帐号:{0}已绑定失败,可能已有相同的微博帐号与其他帐号绑定了", uid, tName), true); } return(RedirectToAction("Edit", "Account")); } return(Redirect(this.getPreUrl())); } else { this.SetResult(re.code, re.msg, false); return(RedirectToAction("Login", "Home")); } }
public ActionResult DoSaveConfig() { ConfigModel config = new ConfigModel(); config = WebUtil.Eval <ConfigModel>(config, "", ""); JsResultObject re = BaseZdBiz.Update(config, "全局配置"); return(JsonText(re, JsonRequestBehavior.AllowGet)); }
public ActionResult DoUpdateImgUrl(string hotelId, string imgUrl) { JsResultObject re = new JsResultObject(); HotelDetailModel hotelDetail = BaseZdBiz.Load <HotelDetailModel>(hotelId); hotelDetail.imgUrl = imgUrl; re = BaseZdBiz.Update(hotelDetail, ""); return(JsonText(re, JsonRequestBehavior.AllowGet)); }
public ActionResult DoSaveFrontPage() { FrontPageModel frontPage = PublicBiz.GetInstant().getCurFrontPage(); frontPage = WebUtil.Eval <FrontPageModel>(frontPage, "", ""); JsResultObject re = BaseZdBiz.Update(frontPage, "首页配置"); return(JsonText(re, JsonRequestBehavior.AllowGet)); }
public ActionResult DoSavePageSeo() { PageSeoModel seo = new PageSeoModel(); seo = WebUtil.Eval <PageSeoModel>(seo, "", ""); JsResultObject re = BaseZdBiz.Update(seo, "Seo配置"); return(JsonText(re, JsonRequestBehavior.AllowGet)); }
public ActionResult DoRebate(string memberId, int rebateAmount, string remark) { JsResultObject re = new JsResultObject(); MemberModel member = BaseZdBiz.Load <MemberModel>(memberId); DataBiz dataBiz = DataBiz.GetInstant(); re = dataBiz.rebateReward(member, rebateAmount, remark); if (re.code == JsResultObject.CODE_SUCCESS) { member.rebateInd = BaseModel.IND_N; re = BaseZdBiz.Update(member, "会员"); } return(JsonText(re, JsonRequestBehavior.AllowGet)); }
public ActionResult DoEdit(string id) { MemberModel member = BaseZdBiz.CreateSession().Load <MemberModel>(id); member = WebUtil.Eval(member, "", ""); JsResultObject re = BaseZdBiz.Update(member, ""); member.pwd = null; WebUtil.SetSessionAttr(typeof(MemberModel).Name, member); if (re.code == JsResultObject.CODE_SUCCESS) { this.SetResult(JsResultObject.CODE_ALERT, "会员信息保存成功", true); } return(View("Edit")); }
public ActionResult KaixinAuthResponse(string access_token) { if (string.IsNullOrEmpty(access_token)) { return(View()); } ICriteria icr = BaseZdBiz.CreateCriteria <MemberModel>(); //icr.Add(Restrictions.Eq("QQ", uid)); string uid = access_token.Split('_')[0]; if (this.getAuthMember() != null) { MemberModel m = BaseZdBiz.Load <MemberModel>(this.getAuthMember().id); m.kaixinUid = uid; JsResultObject re = BaseZdBiz.Update(m, ""); if (re.code == JsResultObject.CODE_SUCCESS) { this.SetResult(JsResultObject.CODE_ALERT, string.Format("当前帐号已和你的开心网帐号:{0}已绑定成功,以后可以直接使用开心网帐号进行登录", uid), true); WebUtil.SetSessionAttr(typeof(MemberModel).Name, m); } else { this.SetResult(JsResultObject.CODE_ALERT, string.Format("当前帐号已和你的开心网帐号:{0}已绑定失败,可能已有相同的开心网帐号与其他帐号绑定了", uid), true); } return(RedirectToAction("Edit", "Account")); } icr.Add(Restrictions.Eq("kaixinUid", uid)); IList <MemberModel> members = icr.List <MemberModel>(); if (members.Count == 1) { MemberModel member = members[0]; member.pwd = ""; WebUtil.SetSessionAttr(typeof(MemberModel).Name, members[0]); return(Redirect(this.getPreUrl())); } else { this.SetResult(JsResultObject.CODE_ALERT, string.Format("你的开心网帐号:{0}已绑定成功,请保完以下基本资料完成登陆", uid), true); MemberModel member = new MemberModel(); // member.weiboUid = uid; member.kaixinUid = uid; ViewData[typeof(MemberModel).Name] = member; return(View("Index")); //return Redirect(WebUtil.GetWebRootPath()+"/MemberAdmin/Reg/Index"); } }
public ActionResult DoSubmit() { MemberModel member = new MemberModel(); member = WebUtil.Eval <MemberModel>(member, "", ""); ViewData[typeof(MemberModel).Name] = member; DataBiz dataBiz = DataBiz.GetInstant(); JsResultObject re = dataBiz.checkMemberRegInfo(member); if (re.code == JsResultObject.CODE_SUCCESS) { re = dataBiz.submitMemberRegInfo(member); if (re.code == JsResultObject.CODE_SUCCESS) { /* * MemberRewardModel reward = new MemberRewardModel(); * reward.busType = MemberRewardModel.BUS_TYPE_NEW_MEMBER; * reward.amount = 10; * reward.remark = string.Format("{0}新会员注册成功",DateTime.Now.ToShortDateString()); * reward.memberFk = member.id; * reward.createDate = DateTime.Now; * reward.setPk(reward.createPk()); * reward.rebateStatus = MemberRewardModel.REBATE_STATUS_UNREBATED; * re= BaseZdBiz.Save(reward); */ member.pwd = ""; WebUtil.SetSessionAttr(typeof(MemberModel).Name, member); OrderModel order = WebUtil.GetSessionAttr <OrderModel>(typeof(OrderModel).Name); if (order != null) { order = BaseZdBiz.Load <OrderModel>(order.id); order.memberFk = member.id; BaseZdBiz.Update(order, ""); WebUtil.SetSessionAttr(typeof(OrderModel).Name, null); } return(View("RequestVaildate")); } else { return(View("Error")); } } ViewData[typeof(JsResultObject).Name] = re; return(View("Index")); }
public ActionResult DoResetPwd(string pwd, string newPwd) { MemberModel member = this.getAuthMember(); member = BaseZdBiz.CreateSession().Load <MemberModel>(member.id); JsResultObject re = BaseZdBiz.Save(member); if (pwd != member.pwd) { this.SetResult(JsResultObject.CODE_ERROR, "密码与会员密码不一致", true); } else { member.pwd = newPwd; re = BaseZdBiz.Update(member, ""); if (re.code == JsResultObject.CODE_SUCCESS) { this.SetResult(JsResultObject.CODE_ALERT, "会员密码修改成功", true); } } return(View("Edit")); }