using System;
using System.Collections;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Text;
using DSWeb.DataAccess;
using System.Data.SqlClient;
using DSWeb.Models;
using DSWeb.EntityDA;
using System.Web.Script.Serialization;
using WebSqlHelper;
namespace DSWeb.box
{
public partial class boxtimeset : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
msg.Text = "";
if (!IsPostBack)
{
databind();
}
}
protected void databind()
{
DataRow dr = BaseClass.db.GetSqlStrRow("select * from sys_remind");
if (dr != null)
{
deadline1.Text = dr["deadline1"].ToString();
deadline2.Text = dr["deadline2"].ToString();
}
}
protected void btnEnter_Click(object sender, ImageClickEventArgs e)
{
if (string.IsNullOrEmpty(deadline1.Text.Trim()) || string.IsNullOrEmpty(deadline1.Text.Trim()))
{
msg.Text = "";
return;
}
if (BaseClass.db.GetSqlStrTable("select * from sys_remind").Rows.Count > 0)
{
BaseClass.db.SetSqlStrNonQuery("update sys_remind set deadline1=@deadline1,deadline2=@deadline2"
, BaseClass.db.GetParameter("deadline1", deadline1.Text)
, BaseClass.db.GetParameter("deadline2", deadline2.Text)
);
}
else
{
BaseClass.db.SetSqlStrNonQuery("insert into sys_remind (deadline1,deadline2)values(@deadline1,@deadline2)"
, BaseClass.db.GetParameter("deadline1", deadline1.Text)
, BaseClass.db.GetParameter("deadline2", deadline2.Text)
);
}
msg.Text = "";
}
}
}