/// <summary>
        /// 审核
        /// </summary>
        /// <param name="Channel">频道</param>
        /// <returns></returns>
        public bool UpdateChannelById(Tz888.Model.Link.LinkChannelType Channel)
        {
            string sql = "update LinkChannelType set ChannelName=@ChannelName,CheckId=@CheckId,Remarks=@Remarks where ChannelId=@ChannelId";

            SqlParameter[] Paras = new SqlParameter[] {
                new SqlParameter("@ChannelId", SqlDbType.Int, 4),
                new SqlParameter("@ChannelName", SqlDbType.VarChar, 50),
                new SqlParameter("@CheckId", SqlDbType.Int, 4),
                new SqlParameter("@Remarks", SqlDbType.NVarChar, 100)
            };
            Paras[0].Value = Channel.ChannelId;
            Paras[1].Value = Channel.ChannelName;
            Paras[2].Value = Channel.CheckId;
            Paras[3].Value = Channel.Remarks;
            int row = crm.ExecuteSql(sql, Paras);

            if (row > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #2
0
 protected void BtnSvae_Click(object sender, EventArgs e)
 {
     try
     {
         Tz888.Model.Link.LinkChannelType Channel = new Tz888.Model.Link.LinkChannelType();
         Channel.ChannelName = Tz888.Common.Utility.PageValidate.HtmlEncode(txtChannelName.Value.Trim());
         Channel.CheckId     = 0;
         Channel.Remarks     = Tz888.Common.Utility.PageValidate.HtmlEncode(txtRemarks.Value.Trim());
         if (bll.AddChannel(Channel))
         {
             Tz888.Common.MessageBox.ShowAndRedirect(this.Page, "添加成功!", "ChannelManage.aspx", false);
         }
         else
         {
             Tz888.Common.MessageBox.Show(this.Page, "添加失败");
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
        /// <summary>
        /// 添加频道
        /// </summary>
        /// <param name="Channel">频道</param>
        /// <returns></returns>
        public bool AddChannel(Tz888.Model.Link.LinkChannelType Channel)
        {
            string sql = "insert into LinkChannelType(ChannelName,CheckId,Remarks) values(@ChannelName,@CheckId,@Remarks)";

            SqlParameter[] Paras = new SqlParameter[] {
                new SqlParameter("@ChannelName", SqlDbType.VarChar, 50),
                new SqlParameter("@CheckId", SqlDbType.Int, 4),
                new SqlParameter("@Remarks", SqlDbType.NVarChar, 100)
            };
            Paras[0].Value = Channel.ChannelName;
            Paras[1].Value = Channel.CheckId;
            Paras[2].Value = Channel.Remarks;
            int row = crm.ExecuteSql(sql, Paras);

            if (row > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
    //频道审核
    protected void BtnSvae_Click(object sender, EventArgs e)
    {
        try
        {
            Tz888.Model.Link.LinkChannelType model = new Tz888.Model.Link.LinkChannelType();
            model.ChannelId   = Convert.ToInt32(ViewState["ChannelId"].ToString());
            model.ChannelName = Tz888.Common.Utility.PageValidate.HtmlEncode(txtChannelName.Value.Trim());
            model.CheckId     = Convert.ToInt32(rblAuditing.SelectedValue);
            model.Remarks     = Tz888.Common.Utility.PageValidate.HtmlEncode(txtRemarks.Value.Trim());

            if (Channel.UpdateChannelById(model))
            {
                Tz888.Common.MessageBox.ShowAndRedirect(this.Page, "审核成功!", "ChannelManage.aspx", false);
            }
            else
            {
                Tz888.Common.MessageBox.ShowAndRedirect(this.Page, "审核失败!", "ChannelManage.aspx", false);
            }
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }