コード例 #1
0
    protected void salvar(object sender, CommandEventArgs e)
    {
        String texto = "<font color=" + color[int.Parse(Session["id"].ToString())].ToKnownColor().ToString() + ">"
            + inicio + "<br>" + Editor1.Text + "<br></font>";
        Editor2.Text += texto;
        Editor2.Text.Replace("<p>", "");
        Editor2.Text.Replace("</p>", "");
        Editor2.Text.Replace("<div>", "");
        Editor2.Text.Replace("</div>", "");

        CDataService dados = new CDataService("atas");
        SqlDataReader dr = dados.SelectSqlReader("select * from atas where idreuniao = " + idreuniao);
        string sql = "";
        if (dr.HasRows)
        {
            sql = "update atas set texto = " + Util.SQLString(Editor2.Text) + " where idreuniao = " + idreuniao;
        }
        else
        {
            sql = "insert into atas(idreuniao,texto,datahora)values(" + idreuniao + "," + Util.SQLString(Editor2.Text) + ", getdate())";
        }
        dr.Close();
        dados.InsertSqlDataVoid(sql);
    }