Exemplo n.º 1
0
        private void ShowInfo()
        {
            Model.wx_userweixin weixin = GetWeiXinCode();
            lblWSiteUrl.Text = MyCommFun.getWebSite() + "/shop/index.aspx?wid=" + weixin.id;
            lblDemain.Text   = MyCommFun.getWebSite().Replace("http://", "");

            IList <WeiXinPF.Model.wx_shop_setting> modellist = bll.GetModelList("wId=" + weixin.id);

            if (modellist == null || modellist.Count <= 0)
            {
                return;
            }
            WeiXinPF.Model.wx_shop_setting model = modellist[0];
            this.lblId.Text        = model.id.ToString();
            this.txtshopName.Text  = model.shopName;
            this.txtcopyright.Text = model.copyright;
            this.txtlogo.Text      = model.logo;
            this.txtbgPic.Text     = model.bgPic;
            this.txttel.Text       = model.tel;
            this.txtaddr.Text      = model.addr;


            //微支付配置信息
            lblzfsqml.Text = MyCommFun.getWebSite() + "/api/payment/";
            lblzfqqsl.Text = "paypage.aspx";
            lblwqtz.Text   = MyCommFun.getWebSite() + "/api/payment/wxpay/feedback.aspx";
            lbljjtz.Text   = MyCommFun.getWebSite() + "/api/payment/wxpay/warning.aspx";
        }
Exemplo n.º 2
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(WeiXinPF.Model.wx_shop_setting model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update wx_shop_setting set ");
            strSql.Append("wid=@wid,");
            strSql.Append("shopName=@shopName,");
            strSql.Append("copyright=@copyright,");
            strSql.Append("logo=@logo,");
            strSql.Append("bgPic=@bgPic,");
            strSql.Append("tel=@tel,");
            strSql.Append("addr=@addr,");
            strSql.Append("createDate=@createDate,");
            strSql.Append("extInt=@extInt,");
            strSql.Append("extStr=@extStr");
            strSql.Append(" where id=@id");
            SqlParameter[] parameters =
            {
                new SqlParameter("@wid",        SqlDbType.Int,         4),
                new SqlParameter("@shopName",   SqlDbType.VarChar,   200),
                new SqlParameter("@copyright",  SqlDbType.VarChar,   200),
                new SqlParameter("@logo",       SqlDbType.VarChar,   500),
                new SqlParameter("@bgPic",      SqlDbType.VarChar,   500),
                new SqlParameter("@tel",        SqlDbType.VarChar,    30),
                new SqlParameter("@addr",       SqlDbType.VarChar,   300),
                new SqlParameter("@createDate", SqlDbType.DateTime),
                new SqlParameter("@extInt",     SqlDbType.Int,         4),
                new SqlParameter("@extStr",     SqlDbType.VarChar,   200),
                new SqlParameter("@id",         SqlDbType.Int, 4)
            };
            parameters[0].Value  = model.wid;
            parameters[1].Value  = model.shopName;
            parameters[2].Value  = model.copyright;
            parameters[3].Value  = model.logo;
            parameters[4].Value  = model.bgPic;
            parameters[5].Value  = model.tel;
            parameters[6].Value  = model.addr;
            parameters[7].Value  = model.createDate;
            parameters[8].Value  = model.extInt;
            parameters[9].Value  = model.extStr;
            parameters[10].Value = model.id;

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 3
0
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public WeiXinPF.Model.wx_shop_setting DataRowToModel(DataRow row)
 {
     WeiXinPF.Model.wx_shop_setting model = new WeiXinPF.Model.wx_shop_setting();
     if (row != null)
     {
         if (row["id"] != null && row["id"].ToString() != "")
         {
             model.id = int.Parse(row["id"].ToString());
         }
         if (row["wid"] != null && row["wid"].ToString() != "")
         {
             model.wid = int.Parse(row["wid"].ToString());
         }
         if (row["shopName"] != null)
         {
             model.shopName = row["shopName"].ToString();
         }
         if (row["copyright"] != null)
         {
             model.copyright = row["copyright"].ToString();
         }
         if (row["logo"] != null)
         {
             model.logo = row["logo"].ToString();
         }
         if (row["bgPic"] != null)
         {
             model.bgPic = row["bgPic"].ToString();
         }
         if (row["tel"] != null)
         {
             model.tel = row["tel"].ToString();
         }
         if (row["addr"] != null)
         {
             model.addr = row["addr"].ToString();
         }
         if (row["createDate"] != null && row["createDate"].ToString() != "")
         {
             model.createDate = DateTime.Parse(row["createDate"].ToString());
         }
         if (row["extInt"] != null && row["extInt"].ToString() != "")
         {
             model.extInt = int.Parse(row["extInt"].ToString());
         }
         if (row["extStr"] != null)
         {
             model.extStr = row["extStr"].ToString();
         }
     }
     return(model);
 }
Exemplo n.º 4
0
        /// <summary>
        /// 保存配置信息
        /// </summary>
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            WeiXinPF.Model.wx_shop_setting model = new WeiXinPF.Model.wx_shop_setting();
            try
            {
                Model.wx_userweixin weixin = GetWeiXinCode();
                int      wId        = weixin.id;
                string   shopName   = this.txtshopName.Text;
                string   copyright  = this.txtcopyright.Text;
                string   logo       = this.txtlogo.Text;
                string   bgPic      = this.txtbgPic.Text;
                string   tel        = this.txttel.Text;
                string   addr       = this.txtaddr.Text;
                DateTime createDate = DateTime.Now;

                int id = int.Parse(lblId.Text.Trim());
                if (id != 0)
                {
                    //修改
                    model = bll.GetModel(id);
                }
                else
                {
                    //添加
                    model.wid        = wId;
                    model.createDate = createDate;
                }

                model.shopName  = shopName;
                model.copyright = copyright;
                model.logo      = logo;
                model.bgPic     = bgPic;
                model.tel       = tel;
                model.addr      = addr;
                if (id != 0)
                {
                    bll.Update(model);
                }
                else
                {
                    id = bll.Add(model);
                }

                AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "修改商城设置"); //记录日志
                JscriptMsg("修改商城设置成功!", "shop_setting.aspx", "Success");
            }
            catch
            {
                JscriptMsg("微网站设置失败!", "", "Error");
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(WeiXinPF.Model.wx_shop_setting model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into wx_shop_setting(");
            strSql.Append("wid,shopName,copyright,logo,bgPic,tel,addr,createDate,extInt,extStr)");
            strSql.Append(" values (");
            strSql.Append("@wid,@shopName,@copyright,@logo,@bgPic,@tel,@addr,@createDate,@extInt,@extStr)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters =
            {
                new SqlParameter("@wid",        SqlDbType.Int,         4),
                new SqlParameter("@shopName",   SqlDbType.VarChar,   200),
                new SqlParameter("@copyright",  SqlDbType.VarChar,   200),
                new SqlParameter("@logo",       SqlDbType.VarChar,   500),
                new SqlParameter("@bgPic",      SqlDbType.VarChar,   500),
                new SqlParameter("@tel",        SqlDbType.VarChar,    30),
                new SqlParameter("@addr",       SqlDbType.VarChar,   300),
                new SqlParameter("@createDate", SqlDbType.DateTime),
                new SqlParameter("@extInt",     SqlDbType.Int,         4),
                new SqlParameter("@extStr",     SqlDbType.VarChar, 200)
            };
            parameters[0].Value = model.wid;
            parameters[1].Value = model.shopName;
            parameters[2].Value = model.copyright;
            parameters[3].Value = model.logo;
            parameters[4].Value = model.bgPic;
            parameters[5].Value = model.tel;
            parameters[6].Value = model.addr;
            parameters[7].Value = model.createDate;
            parameters[8].Value = model.extInt;
            parameters[9].Value = model.extStr;

            object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);

            if (obj == null)
            {
                return(0);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
Exemplo n.º 6
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public WeiXinPF.Model.wx_shop_setting GetModel(int id)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 id,wid,shopName,copyright,logo,bgPic,tel,addr,createDate,extInt,extStr from wx_shop_setting ");
            strSql.Append(" where id=@id");
            SqlParameter[] parameters =
            {
                new SqlParameter("@id", SqlDbType.Int, 4)
            };
            parameters[0].Value = id;

            WeiXinPF.Model.wx_shop_setting model = new WeiXinPF.Model.wx_shop_setting();
            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                return(DataRowToModel(ds.Tables[0].Rows[0]));
            }
            else
            {
                return(null);
            }
        }