public void DataUpdate(int articleId) { Cms.BLL.C_sms bll = new Cms.BLL.C_sms(); Cms.Model.C_sms model = new Cms.Model.C_sms(); model.id = articleId; //ID model.name = this.Title.Text.Trim(); //名字 model.telphone = this.englishtitle.Text; //手机号码 model.content = this.seoDescription.Text.Trim(); //内容 model.state = 0; model.updateTime = Convert.ToDateTime(Cms.Common.ManagementInfo.GetTime()); //时间 if (bll.Update(model)) { string strUTF8 = model.content;//System.Web.HttpUtility.UrlEncode(model.content, Encoding.UTF8); string smsresult = adminUser.Sms(model.telphone, strUTF8); Person p = Cms.Common.Utils.JsonDeserialize <Person>(smsresult); if (p.rescode == "0") { adminUser.AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), model.telphone); //记录日志 int counts = Cms.DBUtility.DbHelperSQL.ExecuteSql("update C_sms set state=1 where id=" + articleId); JscriptMsg("发送信息成功!", "smslist.aspx", "Success"); } else { //Response.Write(smsresult); JscriptMsg("发送信息失败!", "smsEdit.aspx?action=edit&id=" + articleId, "Error"); } } else { JscriptMsg("发送信息失败!", "smsEdit.aspx?action=edit&id=" + articleId, "Error"); } }
//赋值操作 public void DataBind(int articleId) { DataSet ds = new Cms.BLL.C_sms().GetList("id=" + articleId); if (ds.Tables[0].Rows.Count > 0) { DataRow dr = ds.Tables[0].Rows[0]; this.Title.Text = dr["name"].ToString(); //标题 this.englishtitle.Text = dr["telphone"].ToString(); //英文标题 this.seoDescription.Text = dr["content"].ToString(); //SEO描述 } }