コード例 #1
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();
    }
コード例 #2
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);
    }
コード例 #3
0
 public void SaveSendInfo(Model.WxSendInfoModel model)
 {
     Model.CurrentMerModel cm  = BLL.MerchantBLL.CurrentModel();
     DAL.WxSendInfoDAL     dal = new DAL.WxSendInfoDAL();
     if (model.WxSendId == 0)
     {
         model.CreateTime = DateTime.Now;
         model.CreateUser = cm.CurrentUserId;
         dal.Add(model);
     }
     else
     {
         dal.Update(model);
     }
 }
コード例 #4
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);
    }
コード例 #5
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();
    }