public JsResultObject submitComment(MemberCommentModel comment) { JsResultObject re = new JsResultObject(); OrderModel order = BaseZdBiz.Load <OrderModel>(comment.orderFk); MemberRewardRuleModel rule = GetCurRewardRule(); if (order.checkOutDate.AddDays(rule.comValidityDays).CompareTo(DateTime.Now) < 0) { re.code = JsResultObject.CODE_ERROR; re.msg = string.Format("离店日期超出{0}日", rule.comValidityDays); return(re); } comment.createDate = DateTime.Now; comment.setPk(comment.createPk()); re = BaseZdBiz.Save(comment); order.orderStatus = OrderModel.ORDER_STATUS_COMMENTED; re = BaseZdBiz.Update(order, ""); MemberModel member = BaseZdBiz.Load <MemberModel>(comment.memberFk); MemberAccountModel oldAccount = getCurrMemberAccount(member); MemberAccountModel newAccount = new MemberAccountModel(comment.memberFk); newAccount.method = MemberAccountModel.METHOD_COMMENT_REWARD; newAccount.createDate = DateTime.Now; newAccount.method = MemberAccountModel.METHOD_COMMENT_REWARD; newAccount.oldAmount = oldAccount.newAmount; newAccount.changeAmount = Convert.ToInt32(GetReward(order).amount); newAccount.newAmount = newAccount.oldAmount + newAccount.changeAmount; newAccount.setPk(newAccount.createPk()); re = BaseZdBiz.Save(newAccount); return(re); }
public static ConfigModel GetCurrConfig() { ConfigModel config = BaseZdBiz.Load <ConfigModel>("default"); if (config == null) { config = new ConfigModel(); config.id = "default"; } return(config); }
public MemberRewardRuleModel GetCurRewardRule() { MemberRewardRuleModel rule = BaseZdBiz.Load <MemberRewardRuleModel>("default"); if (rule == null) { ICriteria icr = BaseZdBiz.CreateCriteria <MemberRewardRuleModel>(); rule = icr.List <MemberRewardRuleModel>()[0]; } return(rule); }
public JsResultObject checkMemberRegInfo(MemberModel member) { JsResultObject re = new JsResultObject(); JsResultObject tempRe = new JsResultObject(); MemberModel tempMember = BaseZdBiz.Load <MemberModel>(member.id); if (tempMember != null) { re.code = JsResultObject.CODE_ERROR; re.traceStack.Add("exists", string.Format("用户名{0}已被注册,请使用另外用户名的重新注册", member.id)); return(re); } ICriteria icr = BaseZdBiz.CreateCriteria <MemberModel>(); icr.Add(Restrictions.Eq("email", member.email)); if (icr.List().Count > 0) { re.code = JsResultObject.CODE_ERROR; re.traceStack.Add("exists", string.Format("邮箱{0}已被注册,请使用另外邮箱的重新注册", member.email)); return(re); } icr = BaseZdBiz.CreateCriteria <MemberModel>(); icr.Add(Restrictions.Eq("moblie", member.email)); if (icr.List().Count > 0) { re.code = JsResultObject.CODE_ERROR; re.traceStack.Add("moblie", string.Format("手机{0}已被注册,请使用另外手机的重新注册", member.moblie)); return(re); } // tempRe = ServiceUtil.ValidateEmail(member.id); // re.code += tempRe.code; // if (tempRe.code != JsResultObject.CODE_SUCCESS) // { // re.traceStack.Add("email", tempRe.msg); // } tempRe = ServiceUtil.ValidateMoblie(member.moblie); re.code += tempRe.code; if (tempRe.code != JsResultObject.CODE_SUCCESS) { re.traceStack.Add("moblie", tempRe.msg); } return(re); }
public static PageSeoModel getCurPageSeo() { return(BaseZdBiz.Load <PageSeoModel>("default")); }
public FrontPageModel getCurFrontPage() { return(BaseZdBiz.Load <FrontPageModel>("default")); }