예제 #1
0
 public TheAskWaitingUserAnswer(ResponseActionClass rac, string askRoom = null, string askName = null, string askNikeName = null)
 {
     rac.lastAsk = this;
     this.LastRequestWaitResponse = rac;
     roomName = askRoom ?? rac.roomId;
     userName = askName ?? rac.requestUser;
     userNike = askNikeName ?? rac.requestNike;
 }
예제 #2
0
        bool ProcessOneMsg(wxMessageClass wxmsg, ref ShareLotteryPlanClass optPlan)
        {
            ActionDefine define     = null;
            ActionType   curraction = checkTheAction(wxmsg, ref define);

            if (waitingAsk != null)
            {
                if (waitingAsk.ContainsKey(wxmsg.FromUserNam) && waitingAsk[wxmsg.FromUserNam].ContainsKey(wxmsg.FromMemberUserName))
                {
                    //如果回复的人就是等待回答清单中的人,首先判断是否是回复,如果不是回复,宣布首先回答我的问题,其他问题无效,等下再问
                    if (curraction != ActionType.ValidateInfo)
                    {
                        TheAskWaitingUserAnswer askObj = waitingAsk[wxmsg.FromUserNam][wxmsg.FromMemberUserName];
                        string msg = string.Format(@"@{0} 请您先回答我刚才提出的问题!在回答之前我不会接受你其他任何请求.
{1}", wxmsg.FromMemberNikeName, askObj.askMsg);
                        SendMsg(msg, wxmsg.FromUserNam);
                        return(false);
                    }
                }
            }


            ResponseActionClass rac = ResponseActionClass.CreateAction(curraction, this, wxmsg);

            rac.actionDefine = define;
            if (rac == null)
            {
                optPlan = null;
                return(false);
            }
            if (curraction == ActionType.Undefined)
            {
                rac.currPlan = null;
            }
            else
            {
                rac.currPlan = AllPlan.getCurrRoomPlan(wxmsg.FromUserNam);
            }
            return(rac.Response(ref optPlan));

            if (curraction == ActionType.Undefined)
            {
                return(false);
            }
        }
예제 #3
0
        public static ResponseActionClass CreateAction(ActionType act, WXMsgProcess wxprs, wxMessageClass msg)
        {
            ResponseActionClass ret = null;

            switch (act)
            {
            case ActionType.ResetSystem:
            {
                ShareLotteryPlanClass.Reset();
                WXMsgProcess.ActionDic = null;
                break;
            }

            case ActionType.ApplyCreate:
            {
                ret = new ResponseAction_ApplyCreate(wxprs, msg);
                break;
            }

            case ActionType.SubmitNewInfo:
            {
                ret = new ResponseAction_SubmitNewInfo(wxprs, msg);
                break;
            }

            case ActionType.CancelCurr:
            {
                ret = new ResponseAction_CancelCurr(wxprs, msg);
                break;
            }

            case ActionType.SubcribeShares:
            {
                ret = new ResponseAction_SubcribeShares(wxprs, msg);
                break;
            }

            case ActionType.ModifyPlan:
            {
                ret = new ResponseAction_ModifyStatus(wxprs, msg, SharePlanStatus.Ready);
                break;
            }

            case ActionType.AppendShares:
            {
                ret = new ResponseAction_ModifyStatus(wxprs, msg, SharePlanStatus.Paied);
                break;
            }

            case ActionType.JdUnion:
            {
                ret = new ResponseAction_JdUnion(wxprs, msg);
                break;
            }

            case ActionType.ShowPlan:
            {
                ret = new ResponseAction_ShowPlan(wxprs, msg);
                break;
            }

            case ActionType.EndTheSubscribe:
            {
                ret = new ResponseAction_ModifyStatus(wxprs, msg, SharePlanStatus.Paying);
                break;
            }

            case ActionType.DeclareResult:
            {
                ret = new ResponseAction_ModifyStatus(wxprs, msg, SharePlanStatus.Opened);
                break;
            }

            case ActionType.DeclareProfit:
            {
                ret = new ResponseAction_ModifyStatus(wxprs, msg, SharePlanStatus.Opened);
                break;
            }

            case ActionType.ClosePlan:
            {
                ret = new ResponseAction_ClosePlan(wxprs, msg);
                break;
            }

            case ActionType.Charge:
            {
                ret = new ResponseAction_Charge(wxprs, msg);
                break;
            }

            case ActionType.ValidateInfo:
            {
                ret = new ResponseAction_ValidateInfo(wxprs, msg);
                break;
            }

            case ActionType.ManualInstructs:
            {
                ret = new ResponseAction_ManualIntructs(wxprs, msg);
                break;
            }

            case ActionType.Undefined:
            default:
            {
                ret = new ResponseAction_Undefined(wxprs, msg);
                break;
            }
            }
            return(ret);
        }