Ejemplo n.º 1
0
    private void SearchSendPageList()
    {
        decimal WxPtId = ReDecimal("WxPtId", 0);

        int    c        = ReInt("CurrentPage", 1);
        string inputStr = ReStr("inputStr", "");

        bool Invalid = ReBool("Invalid", false);

        BLL.WxBLL bll = new BLL.WxBLL();

        if (WxPtId == 0)
        {
            throw new Exception("没有确定当前的微信公众平台!");
        }

        StringBuilder s = new StringBuilder();

        s.Append(" 1=1 ");
        s.Append(" and Invalid='" + Invalid + "' ");
        s.Append(" and WxPtId='" + WxPtId + "' ");
        if (inputStr.Trim() != "")
        {
            s.Append(" and WxSendTitle like '%" + inputStr + "%' ");
        }
        DataSet ds = bll.SearchSendPageList(c, 20, s.ToString(), "*");

        RePage(ds);
    }
Ejemplo n.º 2
0
    private void SaveWxPtInfo()
    {
        Model.CurrentMerModel cm    = BLL.MerchantBLL.CurrentModel();
        Model.WxPtInfoModel   model = new WxPtInfoModel();
        model.WxPtId = ReDecimal("WxPtId", 0);
        BLL.WxBLL bll = new BLL.WxBLL();
        if (model.WxPtId == 0)
        {
        }
        else
        {
            model = bll.GetWxPtInfoModel(model.WxPtId);
        }

        model.WxPtCode = ReStr("WxPtCode");

        model.WxPtName   = ReStr("WxPtName");
        model.ReUrl      = ReStr("ReUrl");
        model.ReToken    = ReStr("ReToken");
        model.AppId      = ReStr("AppId");
        model.AppSecret  = ReStr("AppSecret");
        model.MerId      = cm.CurrentMerId;
        model.WxPtTypeId = ReInt("WxPtTypeId");
        model.YuanShiId  = ReStr("YuanShiId");
        model.ArticleUrl = ReStr("ArticleUrl", "");
        model.ProUrl     = ReStr("ProUrl", "");
        model.TieZiUrl   = ReStr("TieZiUrl", "");
        bll.SaveWxPtInfo(model);
        ReTrue();
    }
Ejemplo n.º 3
0
    private void GetWxKeyTypeDetailSelectData()
    {
        BLL.WxBLL bll       = new BLL.WxBLL();
        string    KeyTypeId = ReStr("KeyTypeId", "");
        DataTable dt        = bll.GetWxKeyTypeDetailSelectData(KeyTypeId);

        ReDict.Add("jr", JsonHelper.ToJson(dt));
        ReTrue();
    }
Ejemplo n.º 4
0
    private void PostWxPtMenu()
    {
        BLL.WxBLL bll    = new BLL.WxBLL();
        decimal   WxPtId = ReDecimal("WxPtId");
        string    mj     = ReStrDeCode("mj");
        string    re     = bll.PostWxPtMenuJson(WxPtId, mj);

        ReTrue(re);
    }
Ejemplo n.º 5
0
    private void GetWxPtMenu()
    {
        BLL.WxBLL bll    = new BLL.WxBLL();
        decimal   WxPtId = ReDecimal("WxPtId");

        string mj = bll.GetWxPtMenuJson(WxPtId);

        ReTrue(mj);
    }
Ejemplo n.º 6
0
    private void InvalidWxSendInfo()
    {
        bool    Invalid  = ReBool("Invalid", true);
        decimal WxSendId = ReDecimal("WxSendId");

        BLL.WxBLL wbll = new BLL.WxBLL();
        wbll.InvalidWxSendInfo(Invalid, WxSendId);
        ReTrue();
    }
Ejemplo n.º 7
0
 private void SaveQyWxPtVsUser()
 {
     Model.QyWxPtVsUserModel model = new QyWxPtVsUserModel();
     model.UserId       = ReStr("uid");
     model.QyWxPtId     = ReDecimal("QyWxPtId");
     model.QyWxPtUserId = ReStr("QyWxPtUserId");
     model.Memo         = ReStr("Memo");
     BLL.WxBLL wbll = new BLL.WxBLL();
     wbll.SaveWxPtGroupVsUser(model);
     ReTrue();
 }
Ejemplo n.º 8
0
    private void GetQyWxPtGroupInfo()
    {
        Model.QyWxPtGroupModel model = new QyWxPtGroupModel();
        BLL.WxBLL wbll = new BLL.WxBLL();
        model.QyWxPtGroupId = ReDecimal("QyWxPtGroupId", 0);

        DataSet   ds = wbll.GetQyWxPtGorupInfo(model.QyWxPtGroupId);
        DataTable dt = ds.Tables[0];

        ReDict.Add("info", JsonHelper.ToJsonNo1(dt));
        ReTrue();
    }
Ejemplo n.º 9
0
    private void GetSuCaiPageList()
    {
        Model.CurrentMerModel cm = BLL.MerchantBLL.CurrentModel();
        string  inputStr         = ReStr("inputStr", "");
        decimal MerId            = ReDecimal("MerId", cm.CurrentMerId);
        bool    Invalid          = ReBool("Invalid", false);
        int     c = ReInt("c", 1);

        BLL.WxBLL bll = new BLL.WxBLL();

        DataSet ds = bll.GetSuCaiPageList(" Invalid='" + Invalid + "'  and MerId='" + MerId + "' and WxSuCaiTitle like '%" + inputStr + "%' ", c, 20, "*");

        RePage(ds);
    }
Ejemplo n.º 10
0
    private void GetQyWxPtInfo()
    {
        BLL.WxBLL wbll     = new BLL.WxBLL();
        decimal   QyWxPtId = ReDecimal("QyWxPtId", 0);
        DataSet   ds       = wbll.GetQyWxPtInfo(QyWxPtId);
        DataTable dt       = ds.Tables[0];

        if (dt.Rows.Count == 0)
        {
            throw new Exception("企业微信号不存在!");
        }

        ReDict.Add("QyWxPt", JsonHelper.ToJsonNo1(dt));
        ReTrue();
    }
Ejemplo n.º 11
0
    private void GetWxPtInfo()
    {
        BLL.WxBLL bll    = new BLL.WxBLL();
        decimal   WxPtId = ReDecimal("WxPtId", 0);

        if (WxPtId == 0)
        {
            throw new Exception("没传ID啊!");
        }
        DataSet ds = bll.GetWxPtInfoData(WxPtId);

        string jr = JsonHelper.ToJson(ds);

        ReDict.Add("da", jr);

        ReTrue();
    }
Ejemplo n.º 12
0
    private void SearchWxPrPageList()
    {
        Model.CurrentMerModel cm = BLL.MerchantBLL.CurrentModel();

        BLL.WxBLL bll         = new BLL.WxBLL();
        int       CurrentPage = ReInt("CurrentPage", 1);
        bool      Invalid     = ReBool("Invalid", false);

        StringBuilder s = new StringBuilder();

        s.Append(" MerId='" + cm.CurrentMerId + "' ");
        s.Append(" and Invalid='" + Invalid + "' ");

        DataSet ds = bll.GetWxPtPageList(s.ToString(), CurrentPage, 20, " * ");

        RePage(ds);
    }
Ejemplo n.º 13
0
    private void GetSendInfo()
    {
        decimal WxSendId = ReDecimal("WxSendId", 0);

        if (WxSendId == 0)
        {
            throw new Exception("WxSendId不能为空");
        }
        BLL.WxBLL bll = new BLL.WxBLL();

        DataSet ds = bll.GetWxSendInfo(WxSendId);

        DataTable dtSendInfo = ds.Tables[0];
        DataTable dtKeyList  = ds.Tables[1];

        ReDict.Add("SendInfo", JsonHelper.ToJsonNo1(dtSendInfo));
        ReDict.Add("KeyList", JsonHelper.ToJson(dtKeyList));
        ReTrue();
    }
Ejemplo n.º 14
0
    private void SaveQyWxPtGroupInfo()
    {
        Model.QyWxPtGroupModel model = new QyWxPtGroupModel();
        BLL.WxBLL wbll = new BLL.WxBLL();
        model.QyWxPtGroupId = ReDecimal("QyWxPtGroupId", 0);
        if (model.QyWxPtGroupId != 0)
        {
            model = wbll.GetQyWxPtGroupModel(model.QyWxPtGroupId);
        }

        model.QyWxPtId        = ReDecimal("QyWxPtId", 0);
        model.Secret          = ReStr("Secret");
        model.QyWxPtGroupMemo = ReStr("QyWxPtGroupMemo");

        wbll.SaveQyWxPtGroupInfo(model);
        ReDict2.Add("QyWxPtGroupId", model.QyWxPtGroupId.ToString());

        ReTrue();
    }
Ejemplo n.º 15
0
    private void SaveQyWxPtAppInfo()
    {
        BLL.WxBLL            wbll  = new BLL.WxBLL();
        Model.QyWxPtAppModel model = new QyWxPtAppModel();
        model.QyWxPtAppId = ReDecimal("", 0);

        model.AgentID        = ReStr("AgentID", "");
        model.DefaultGroupId = ReDecimal("DefaultGroupId", 0);
        model.QyWxPtAppMemo  = ReStr("QyWxPtAppMemo", "");
        model.QyWxPtAppName  = ReStr("QyWxPtAppName", "");
        model.QyWxPtId       = ReDecimal("QyWxPtId", 0);
        if (model.QyWxPtId == 0)
        {
            throw new Exception("必须确定企业微信平台!");
        }
        wbll.SaveQyWxPtAppInfo(model);
        ReDict2.Add("QyWxPtAppId", model.QyWxPtAppId.ToString());
        ReTrue();
    }
Ejemplo n.º 16
0
    private void SaveQyWxPtInfo()
    {
        BLL.WxBLL         wbll  = new BLL.WxBLL();
        Model.QyWxPtModel model = new QyWxPtModel();
        model.QyWxPtId = ReDecimal("QyWxPtId", 0);
        if (model.QyWxPtId != 0)
        {
            model = wbll.GetQyWxPtModel(model.QyWxPtId);
        }
        model.CorpId  = ReStr("CorpId", "");
        model.MerId   = ReDecimal("MerId", 0);
        model.OrderNo = ReInt("OrderNo", 1);

        model.QyWxPtMemo = ReStr("QyWxPtMemo", "");
        model.QyWxPtName = ReStr("QyWxPtName", "");


        wbll.SaveQyWxPtInfo(model);
        ReTrue();
    }
Ejemplo n.º 17
0
    private void GetQyWxPtVsUserList()    //微信平台和用户的关系 必须带有MerId否则无意义
    {
        StringBuilder s = new StringBuilder();

        BLL.WxBLL wbll = new BLL.WxBLL();

        decimal QyWxPtId    = ReDecimal("QyWxPtId", 0);
        string  UserIdStr   = ReStr("UserIdStr", "");
        int     CurrentPage = ReInt("CurrentPage", 1);
        decimal MerId       = ReDecimal("MerId");

        s.Append(" 1=1 ");
        if (UserIdStr != "")
        {
            s.Append(" and UserId like='%" + UserIdStr + "%'  ");
        }

        s.Append(" and MerId=" + MerId + " ");
        DataSet ds = wbll.GetQyWxPtVsUserList(s.ToString(), " UserId desc ", CurrentPage, 20, " * ");

        RePage2(ds);
    }
Ejemplo n.º 18
0
 protected void Page_Load(object sender, EventArgs e)
 {
     BLL.WxBLL bll = new BLL.WxBLL();
     string    str = bll.HttpPost();
 }
Ejemplo n.º 19
0
    private void SaveSendInfo()
    {
        #region 事务开启

        TransactionOptions transactionOption = new TransactionOptions();
        transactionOption.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted;
        using (TransactionScope transactionScope = new TransactionScope(TransactionScopeOption.Required, transactionOption))
        {
            #endregion

            Model.WxSendInfoModel model = new WxSendInfoModel();
            BLL.WxBLL             bll   = new BLL.WxBLL();
            model.WxSendId = ReDecimal("WxSendId", 0);

            if (model.WxSendId == 0)
            {
                model.WxPtId = ReDecimal("WxPtId");
            }
            else
            {
                //如果是修改, 选取出原来的数据
                model = bll.GetWxSendModel(model.WxSendId);
            }
            model.WxSendTitle   = ReStr("WxSendTitle");
            model.WxSendType    = ReStr("WxSendType");
            model.WxSendClassId = ReInt("WxSendClassId");
            model.Memo          = ReStr("Memo");
            model.FmImgId       = ReStr("FmImgId");
            model.WxSuCaiId     = ReDecimal("WxSuCaiId", 0);
            model.SendContent   = ReStrDeCode("SendContent");
            bll.SaveSendInfo(model);



            DataTable dtKeys = ReTable("KeysAreray");

            if (dtKeys.Rows.Count == 0)
            {
                throw new Exception("没有添加激发时间, 这个回应没有触发将没有意义!");
            }


            DAL.WxKeyDAL keyDal = new DAL.WxKeyDAL();
            keyDal.DeleteList(" WxSendId='" + model.WxSendId + "' ");  //首先删除所有的key关联关系

            foreach (DataRow drKeys in dtKeys.Rows)
            {
                if (model.WxSendId == 0)
                {
                    throw new Exception("在执行插入之后,WxSendId不能为0!");
                }

                Model.WxKeyModel KeyModel = new WxKeyModel();
                KeyModel.WxSendId        = model.WxSendId;
                KeyModel.KeyTitle        = drKeys["KeyTitle"].ToString();
                KeyModel.KeyTypeId       = drKeys["KeyTypeId"].ToString();
                KeyModel.KeyTypeDetailId = drKeys["KeyTypeDetailId"].ToString();
                keyDal.Add(KeyModel);   //逐个添加新的关联关系
            }

            ReDict.Add("WxSendId", model.WxSendId);
            #region 事务关闭

            transactionScope.Complete();
        }
        #endregion


        ReTrue();
    }
Ejemplo n.º 20
0
 private void SearchSuCaiList()
 {
     BLL.WxBLL bll = new BLL.WxBLL();
 }
Ejemplo n.º 21
0
    private void SaveSuCaiInfo()
    {
        Model.WxSuCaiInfoModel model = new WxSuCaiInfoModel();
        BLL.WxBLL             wbll   = new BLL.WxBLL();
        Model.CurrentMerModel cm     = BLL.MerchantBLL.CurrentModel();



        #region 事务开启

        TransactionOptions transactionOption = new TransactionOptions();
        transactionOption.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted;
        using (TransactionScope transactionScope = new TransactionScope(TransactionScopeOption.Required, transactionOption))
        {
            #endregion


            model.WxSuCaiInfoId = ReDecimal("WxSuCaiInfoId", 0);

            if (model.WxSuCaiInfoId == 0)
            {
                //新增
            }
            else
            {
                model = wbll.GetSuCaiInfoModel(model.WxSuCaiInfoId);
            }

            model.WxSuCaiTitle = ReStr("WxSuCaiTitle");
            model.InputCode    = ReStr("InputCode", Common.PinYin.GetCodstring(model.WxSuCaiTitle));

            model.WxSuCaiContent = ReStrDeCode("WxSuCaiContent");
            model.Memo           = ReStr("Memo", "");
            model.WxSuCaiTypeId  = ReInt("WxSuCaiTypeId");
            model.WxSuCaiClassId = ReInt("WxSuCaiClassId");
            model.CreateUser     = cm.CurrentUserId;
            model.Invalid        = ReBool("Invalid", false);
            model.FmImgId        = ReStr("FmImgId", "");
            model.MerId          = ReDecimal("MerId", cm.CurrentMerId);



            wbll.SaveSuCaiInfo(model);

            switch (model.WxSuCaiClassId)
            {
            case 2:
                //如果是图文
                wbll.RemoveSuCaiDetail(" WxSuCaiInfoId='" + model.WxSuCaiInfoId + "' ");
                DataTable dtDetail = ReTable("detail");

                if (dtDetail.Rows.Count == 0)
                {
                    throw new Exception("图文回复需要至少一条明细!");
                }

                foreach (DataRow drDetail in dtDetail.Rows)
                {
                    Model.WxSuCaiDetailModel DetailModel = new WxSuCaiDetailModel();

                    DetailModel.ImgId             = drDetail["ImgId"].ToString();
                    DetailModel.OrderNo           = int.Parse(drDetail["OrderNo"].ToString());
                    DetailModel.OtherPara         = drDetail["OtherPara"].ToString();
                    DetailModel.ReKey             = drDetail["ReKey"].ToString();
                    DetailModel.Url               = HttpUtility.UrlDecode(drDetail["Url"].ToString());
                    DetailModel.WxSuCaiInfoId     = model.WxSuCaiInfoId;
                    DetailModel.WxSuCaiDetailMemo = drDetail["WxSuCaiDetailMemo"].ToString();
                    try
                    {
                        DetailModel.WxSuCaiDetailClassId = int.Parse(drDetail["WxSuCaiDetailClassId"].ToString());
                    }
                    catch
                    {
                        continue;
                    }


                    try
                    {
                        DetailModel.WxSuCaiDetailContent = drDetail["WxSuCaiDetailContent"].ToString();
                    }
                    catch
                    {
                        DetailModel.WxSuCaiDetailContent = "";
                    }

                    DetailModel.WxSuCaiDetailId    = 0;   //必须的,就靠它新增
                    DetailModel.WxSuCaiDetailTitle = drDetail["WxSuCaiDetailTitle"].ToString();
                    wbll.SaveSuCaiDetail(DetailModel);
                }
                break;

            default:
                //其他


                break;
            }



            #region 事务关闭

            transactionScope.Complete();
        }

        #endregion
        ReDict2.Add("WxSuCaiInfoId", model.WxSuCaiInfoId.ToString());
        ReTrue();
    }
Ejemplo n.º 22
0
    private void SendPeiHuoRemind()  //配货人员提醒
    {
        BLL.WxBLL wbll        = new BLL.WxBLL();
        string    DingDanId   = ReStr("DingDanId", "");
        DataTable dtUser      = ReTable("UserList");
        string    SendMemo    = ReStr("SendMemo", "");
        decimal   QyWxPtAppId = ReDecimal("QyWxPtAppId", 0);


        StringBuilder w          = new StringBuilder();
        StringBuilder s          = new StringBuilder();
        List <string> ToUserList = new List <string>();

        #region 事务开启

        TransactionOptions transactionOption = new TransactionOptions();
        transactionOption.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted;
        using (TransactionScope transactionScope = new TransactionScope(TransactionScopeOption.Required, transactionOption))
        {
            #endregion

            BLL.MerchantBLL mbll = new BLL.MerchantBLL();
            mbll.ShenHeDingdan(DingDanId, 1, "通过审核");
            s.Append("SELECT * FROM dbo.DingDanDetailView WITH(NOLOCK) WHERE DingDanId='" + DingDanId + "' ORDER BY DingDanDetailTypeId ");
            s.Append(" SELECT *  FROM dbo.DingDanView  WITH(NOLOCK) WHERE DingDanId='" + DingDanId + "' ");

            DataSet   ds       = DAL.DalComm.BackData(s.ToString());
            DataTable dtDetail = ds.Tables[0];
            DataTable dtInfo   = ds.Tables[1];
            if (dtInfo.Rows.Count != 1)
            {
                throw new Exception("这是个什么订单?");
            }
            DataRow  drInfo       = dtInfo.Rows[0];
            decimal  MerId        = decimal.Parse(drInfo["MerchantId"].ToString());
            decimal  amount       = decimal.Parse(drInfo["Amount"].ToString());
            DateTime PeiSongTime1 = DateTime.Parse(drInfo["PeiSongTime1"].ToString());
            DateTime PeiSongTime2 = DateTime.Parse(drInfo["PeiSongTime2"].ToString());
            amount = Math.Round(amount, 2);
            w.Append("编号:\n " + DingDanId + " \n");

            if (SendMemo.Trim() != "")
            {
                w.Append("调度备注:" + SendMemo + " \n");
            }

            w.Append("总金额:" + amount + " \n");
            w.Append("物流:" + PeiSongTime1.ToString("yy年MM月dd日 hh时mm分") + "-" + PeiSongTime2.ToString("yy年MM月dd日 hh时mm分") + "");
            w.Append("(" + drInfo["PeiSongTypeName"] + ") \n");
            var url = "http://www.sjdfcs.com/App/AppDingDanList_PeiHuo.aspx?DingDanId=" + DingDanId + "";

            w.Append("<a href='" + wbll.QyWxUrl(url, MerId) + "' >查看详细</a> \n");
            if (dtDetail.Rows.Count == 0)
            {
                throw new Exception("这个订单[" + DingDanId + "]没有明细吗?");
            }
            s.Clear();
            foreach (DataRow drUser in dtUser.Rows)
            {
                ToUserList.Add(drUser["QyWxPtUserId"].ToString());
                s.Append(" UPDATE dbo.DingDanInfo SET PeiHuoUserId='" + drUser["UserId"].ToString() + "',Status=20 WHERE DingDanId='" + DingDanId + "' ");
            }
            DAL.DalComm.ExReInt(s.ToString());



            #region 暂时无用

            //foreach (DataRow drDetail in dtDetail.Rows)
            //{


            //    decimal Price = decimal.Parse(drDetail["Price"].ToString());
            //    Price = Math.Round(Price, 2);
            //    decimal Quantity = decimal.Parse(drDetail["Quantity"].ToString());
            //    Quantity = Math.Round(Quantity);

            //    string 规格 = drDetail["规格"].ToString().Trim();

            //    int DingDanDetailTypeId = int.Parse(drDetail["DingDanDetailTypeId"].ToString());
            //    if (DingDanDetailTypeId == 10)
            //    {

            //        w.Append("配送费:" + Price + "元 \n");

            //    }
            //    else
            //    {


            //        //如果是产品
            //        w.Append("[" + drDetail["产品编号"] + "]");
            //        w.Append("" + drDetail["产品名称"] + ",");
            //        if (规格 != "")
            //        {
            //            w.Append("规格:" + drDetail["规格"] + ",");

            //        }

            //        w.Append("单价:" + Price + "元,");
            //        w.Append("数量:" + Quantity + "" + drDetail["计量单位"] + "");
            //        w.Append(" \n ");
            //    }
            //}
            #endregion



            #region 事务关闭

            transactionScope.Complete();
        }
        #endregion
        string jsonStr = wbll.SendQyTextMsg(ToUserList, w.ToString(), QyWxPtAppId);

        ReDict.Add("ReJson", jsonStr);
        ReTrue();
    }