Ejemplo n.º 1
0
        public ActionResult ChangeStatus()
        {
            ChangeMemberStatusArgs args = RequestArgs <ChangeMemberStatusArgs>();

            if (args == null)
            {
                return(FailedResult("参数无效。"));
            }

            NormalResult result = _memberManager.ChangeStatus(args);

            return(ApiResult(result.Successful, result.Message));
        }
Ejemplo n.º 2
0
        public NormalResult ChangeStatus(ChangeMemberStatusArgs args)
        {
            using (Entities db = new Entities())
            {
                IQueryable <Member> queryable = db.Member;

                Member dbMember = queryable.FirstOrDefault(e => e.id == args.MemberId);
                if (dbMember == null)
                {
                    return(new NormalResult("指定的数据不存在。"));
                }

                if (dbMember.status == args.Status)
                {
                    return(new NormalResult());
                }

                dbMember.status = args.Status;


                switch (dbMember.status)
                {
                case 2:     //审核通过
                            //发短信
                    Yuntongxun.SendTemplateSMS(dbMember.phone_num, "202414", new string[] { });
                    break;

                case 3:     //审核不通过
                    //发短信
                    break;

                default:
                    break;
                }

                dbMember.update_time = DateTime.Now;

                db.SaveChanges();
            }

            return(new NormalResult());
        }