/// <summary>
        /// 检查是否登录
        /// </summary>
        /// <returns></returns>
        // GET: Base
        public bool CheckIsLogin()
        {
            if (Session["acount"] == null || string.IsNullOrEmpty(Session["acount"].ToString()))
            {
                return(false);
            }

            ViewData["platformName"] = WebConfigeOpert.GetPlatformName();
            return(true);
        }
        /// <summary>
        /// 微信API入口
        /// </summary>
        /// <returns></returns>
        public string Index()
        {
            //// 只有在第一次服务搭建的时候开启,后面注释掉该代码
            /// CheckSignature();
            try
            {
                MwxMessage wx  = GetWxMessage();
                string     res = "";

                string sendMessage = string.Empty;
                if (wx.MsgType == "text")
                {
                    if (wx.Content == "待送货订单")
                    {
                        ///// 查询待送货订单
                        //// 包括3条数据
                        //// 1、总待送货
                        //// 2、半小时内需要送货的订单数
                        //// 3、今天内需要送货的订单数
                        sendMessage = this.GetSendGoodesCount();
                    }
                    else
                    {
                        //// 记录一条日志信息
                        sendMessage = string.Format("您好, {0}已收到你消息。!", WebConfigeOpert.GetPlatformName());
                    }
                }

                if (!string.IsNullOrEmpty(sendMessage))
                {
                    res = new WXApiOpert().GetSendMessage(wx, sendMessage);
                }

                return(res);
            }
            catch (Exception)
            {
                return(string.Empty);
            }
        }
 public marketController()
 {
     ViewData["platformName"] = WebConfigeOpert.GetPlatformName();
     ViewData["PalteWebSite"] = WebConfigeOpert.GetPalteWebSite();
 }
Exemple #4
0
 // GET: Login
 public ActionResult Index()
 {
     Session.Abandon();//清除全部Session
     ViewData["platformName"] = WebConfigeOpert.GetPlatformName();
     return(View());
 }