Exemplo n.º 1
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            Cust_date.Text = System.DateTime.Now.Date.ToString().Split(' ')[0];
            textBox1.Text  = Cust_date.Text;

            SqlConnection Conn = new SqlConnection(connectionString_profile);

            Conn.Open();
            SqlCommand    cmd     = new SqlCommand("select Installment_ID FROM Gold_Investment order by Installment_ID desc", Conn);
            SqlDataReader reader  = cmd.ExecuteReader();
            String        inst_id = "#I200";

            if (reader.Read())
            {
                inst_id = reader.GetString(0);
            }
            Conn.Close();

            int id = int.Parse(inst_id.Split('I')[1]);

            install_ID.Text = "#I" + ++id;
            Cust_id.Focus();
        }
Exemplo n.º 2
0
 private void RootWindow_Loaded(object sender, RoutedEventArgs e)
 {
     Cust_date.Text = System.DateTime.Now.Date.ToString().Split(' ')[0];
     Cust_id.Focus();
 }