using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using lib;

public partial class Controls_doji : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void DropDownList1_TextChanged(object sender, EventArgs e)
    {
        RP rp = new RP();
        TextBox1.Text = rp.Select_DOJI(DrList.Text);        
        //TextBox1.Text = DrList.Text;
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        RP rp = new RP();
        TextBox1.Text = rp.Select_DOJI(DrList.Text);
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        RP rp = new RP();
        rp.Update_DOJI(DrList.Text, TextBox1.Text);
        if (DrList.Text == "DOJI")
        {
            rp.Update_DOJI("GUI", "1");
        }
        if (DrList.Text == "DOJIXH")
        {
            DateTime dts = DateTime.Now;
            DateTime dte = dts;
            dte = dte.AddHours(20 - dte.Hour);
            dte = dte.AddMinutes(30 - dte.Minute);            
            rp.Update_DOJI("GUIXH", "1");
            rp.Update_DOJI("XHTIMES", dts.ToString());
            rp.Update_DOJI("XHTIMEE", dte.ToString());         
        }
    }
}
