protected void TextBox1_TextChanged(object sender, System.EventArgs e)
    {
        SqlConnection con1 = new SqlConnection(ConfigurationManager.AppSettings["connection"]);

        con1.Open();
        string        query = "Select * from product_stock where Com_Id='" + company_id + "' and barcode='" + TextBox1.Text + "'";
        SqlCommand    cmd1  = new SqlCommand(query, con1);
        SqlDataReader dr    = cmd1.ExecuteReader();

        if (dr.Read())
        {
            TextBox12.Text = dr["Product_name"].ToString();
            TextBox17.Text = dr["mrp"].ToString();
            TextBox5.Text  = "1";
        }
        con1.Close();
        TextBox12.Focus();


        try
        {
            float a = float.Parse(TextBox17.Text);
            float b = float.Parse(TextBox5.Text);
            TextBox18.Text = (a * b).ToString();

            Button3.Focus();
        }
        catch (Exception we)
        { }
    }
        private void ReverseTextboxes()
        {
            TextBox1.Text  = TextBox2.Text;
            TextBox2.Text  = TextBox3.Text;
            TextBox3.Text  = TextBox4.Text;
            TextBox4.Text  = TextBox5.Text;
            TextBox5.Text  = TextBox6.Text;
            TextBox6.Text  = TextBox7.Text;
            TextBox7.Text  = TextBox8.Text;
            TextBox8.Text  = TextBox9.Text;
            TextBox9.Text  = TextBox10.Text;
            TextBox10.Text = TextBox11.Text;
            TextBox11.Text = TextBox12.Text;

            if (AllRounds.Count > 0)
            {
                int index = AllRounds.Count() - 13;

                if (AllRounds.Count > 12)
                {
                    Round round = AllRounds[index];
                    TextBox12.Text = round.WinningNumber.ToString();
                }
                else
                {
                    TextBox12.Clear();
                }
            }
        }
Ejemplo n.º 3
0
 public void ClearTextBoxes()
 {
     TextBox1.Clear();
     TextBox2.Clear();
     TextBox3.Clear();
     TextBox4.Clear();
     TextBox5.Clear();
     TextBox6.Clear();
     TextBox7.Clear();
     TextBox8.Clear();
     TextBox9.Clear();
     TextBox10.Clear();
     TextBox11.Clear();
     TextBox12.Clear();
     TextBoxID.Clear();
 }
Ejemplo n.º 4
0
    protected void TextBox1_TextChanged(object sender, System.EventArgs e)
    {
        if (User.Identity.IsAuthenticated)
        {
            SqlConnection con2 = new SqlConnection(ConfigurationManager.AppSettings["connection"]);
            SqlCommand    cmd2 = new SqlCommand("select * from user_details where Name='" + User.Identity.Name + "'", con2);
            SqlDataReader dr2;
            con2.Open();
            dr2 = cmd2.ExecuteReader();
            if (dr2.Read())
            {
                company_id = Convert.ToInt32(dr2["com_id"].ToString());



                SqlConnection con1 = new SqlConnection(ConfigurationManager.AppSettings["connection"]);
                con1.Open();
                string        query = "Select * from product_stock where Com_Id='" + company_id + "' and barcode='" + TextBox1.Text + "'";
                SqlCommand    cmd1  = new SqlCommand(query, con1);
                SqlDataReader dr    = cmd1.ExecuteReader();
                if (dr.Read())
                {
                    TextBox12.Text = dr["Product_name"].ToString();
                    TextBox17.Text = dr["mrp"].ToString();
                    TextBox5.Text  = "1";
                    TextBox15.Text = "0";
                    TextBox16.Text = "0.0";
                }
                con1.Close();

                TextBox12.Focus();
                try
                {
                    float a = float.Parse(TextBox17.Text);
                    float b = float.Parse(TextBox5.Text);
                    TextBox18.Text = (a * b).ToString();
                    Button3.Focus();
                }
                catch (Exception we)
                { }
            }
            con2.Close();
        }
    }
    protected void TextBox19_TextChanged(object sender, System.EventArgs e)
    {
        SqlConnection con1 = new SqlConnection(ConfigurationManager.AppSettings["connection"]);

        con1.Open();
        string        query = "Select * from sales_entry where Com_Id='" + company_id + "' and invoice_no='" + TextBox19.Text + "'";
        SqlCommand    cmd1  = new SqlCommand(query, con1);
        SqlDataReader dr    = cmd1.ExecuteReader();

        if (dr.Read())
        {
            TextBox8.Text  = Convert.ToDateTime(dr["date"]).ToString("MM/dd/yyyy");
            TextBox6.Text  = dr["Mobile_no"].ToString();
            TextBox13.Text = dr["customer_name"].ToString();
            TextBox14.Text = dr["customer_Address"].ToString();
            DropDownList3.SelectedItem.Text = dr["staff_name"].ToString();
        }
        con1.Close();
        BindData();
        TextBox12.Focus();
    }