Beispiel #1
0
        /// <summary>
        /// 修改在线充值配置
        /// </summary>
        /// <param name="config">充值产品</param>
        /// <returns></returns>
        public int UpdateOnLineWeChat(OnLineWeChat config)
        {
            StringBuilder sqlQuery = new StringBuilder();

            sqlQuery.Append("UPDATE OnLineWeChat SET ")
            .Append("ConfigName=@ConfigName,")
            .Append("WeChat=@WeChat,")
            .Append("NickName=@NickName,")
            .Append("SortID=@SortID,")
            .Append("TagID=@TagID,")
            .Append("Nullity=@Nullity")
            .Append(" WHERE ConfigID=@ConfigID");

            var prams = new List <DbParameter>
            {
                Database.MakeInParam("ConfigName", config.ConfigName),
                Database.MakeInParam("WeChat", config.WeChat),
                Database.MakeInParam("NickName", config.NickName),
                Database.MakeInParam("SortID", config.SortID),
                Database.MakeInParam("TagID", config.TagID),
                Database.MakeInParam("Nullity", config.Nullity),
                Database.MakeInParam("ConfigID", config.ConfigID)
            };

            return(Database.ExecuteNonQuery(CommandType.Text, sqlQuery.ToString(), prams.ToArray()));
        }
Beispiel #2
0
        /// <summary>
        /// 数据保存
        /// </summary>
        protected void btnSave_Click(object sender, EventArgs e)
        {
            OnLineWeChat config = new OnLineWeChat();

            if (IntParam > 0)
            {
                if (!AuthUserOperationPermission(Permission.Edit))
                {
                    return;
                }
                config = FacadeManage.aideTreasureFacade.GetOnLineWeChat(IntParam);
            }


            config.ConfigName = CtrlHelper.GetText(txtConfigName);
            config.WeChat     = CtrlHelper.GetText(txtWeChat);
            config.SortID     = CtrlHelper.GetInt(txtSortID, 0);
            config.NickName   = CtrlHelper.GetText(txtNickName);
            config.Nullity    = Convert.ToByte(rblNullity.SelectedValue);
            config.TagID      = Convert.ToByte(ddlTagID.SelectedValue);

            int result = IntParam > 0 ? FacadeManage.aideTreasureFacade.UpdateOnLineWeChat(config) : FacadeManage.aideTreasureFacade.InsertOnLineWeChat(config);

            if (result > 0)
            {
                ShowInfo("操作成功", "OnLineWeChatList.aspx", 1200);
            }
            else
            {
                ShowError("操作失败");
            }
        }
Beispiel #3
0
 /// <summary>
 /// 数据绑定
 /// </summary>
 private void BindData()
 {
     if (IntParam > 0)
     {
         OnLineWeChat config = FacadeManage.aideTreasureFacade.GetOnLineWeChat(IntParam);
         if (config != null)
         {
             CtrlHelper.SetText(txtConfigName, config.ConfigName.ToString());
             CtrlHelper.SetText(txtSortID, config.SortID.ToString());
             CtrlHelper.SetText(txtWeChat, config.WeChat.ToString());
             CtrlHelper.SetText(txtNickName, config.NickName.ToString());
             ddlTagID.SelectedValue   = config.TagID.ToString();
             rblNullity.SelectedValue = config.Nullity.ToString();
         }
     }
 }
Beispiel #4
0
        /// <summary>
        /// 新增在线充值配置
        /// </summary>
        /// <param name="config">充值产品</param>
        /// <returns></returns>
        public int InsertOnLineWeChat(OnLineWeChat config)
        {
            string sqlQuery =
                @"INSERT INTO OnLineWeChat(ConfigName,WeChat,NickName,SortID,TagID,Nullity,CollectDate) 
                                        VALUES(@ConfigName,@WeChat,@NickName,@SortID,@TagID,@Nullity,getdate())";

            var prams = new List <DbParameter>
            {
                Database.MakeInParam("ConfigName", config.ConfigName),
                Database.MakeInParam("WeChat", config.WeChat),
                Database.MakeInParam("NickName", config.NickName),
                Database.MakeInParam("SortID", config.SortID),
                Database.MakeInParam("TagID", config.TagID),
                Database.MakeInParam("Nullity", config.Nullity),
            };

            return(Database.ExecuteNonQuery(CommandType.Text, sqlQuery, prams.ToArray()));
        }
Beispiel #5
0
 /// <summary>
 /// 修改在线充值配置
 /// </summary>
 /// <param name="config">充值产品</param>
 /// <returns></returns>
 public int UpdateOnLineWeChat(OnLineWeChat config)
 {
     return(aideTreasureData.UpdateOnLineWeChat(config));
 }
Beispiel #6
0
 /// <summary>
 /// 新增在线充值配置
 /// </summary>
 /// <param name="config">充值产品</param>
 /// <returns></returns>
 public int InsertOnLineWeChat(OnLineWeChat config)
 {
     return(aideTreasureData.InsertOnLineWeChat(config));
 }