Exemplo n.º 1
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        DataView dv3   = (DataView)SelectTag.Select(DataSourceSelectArguments.Empty);
        int      taggg = (int)dv3.Table.Rows[0][0];

        x = Convert.ToDouble(TextBox8.Text);
        y = Convert.ToDouble(TextBox3.Text);
        if (taggg == 4)
        {
            if (x == y)
            {
                TagUpdate.Update();
            }
        }
        else if (taggg == 6)
        {
            if (x == y)
            {
                TagUpdate0.Update();
            }
        }
        string sttt = "";

        sttt = DateTime.Now.ToLongTimeString();
        if (sttt.Length == 10)
        {
            sttt = "0" + sttt;
        }
        string post = sttt.Substring(9, 2);

        if (post == "PM")
        {
            int h = Convert.ToInt32(sttt.Substring(0, 2)) + 12;
            TTime.Text = h.ToString() + sttt.Substring(2, 6);
        }
        else
        {
            TTime.Text = sttt.Substring(0, 8);
        }
        y             = x - y;
        TextBox6.Text = y.ToString();
        PaymentInsert.Insert();
        TextBox5.Text = DateTime.Now.ToShortDateString();
        SqlDataSource1.Update();
        LinkButton1.Enabled     = true;
        Button3.Enabled         = true;
        RangeValidator1.Visible = false;
    }