protected void btnCreateNArticle_Click(object sender, EventArgs e)
        {
            //if (TextBox3.Text != "")
            //{
            AddDefaultFirstRecord();
            PnlModifyArticle.Visible  = false;
            pnlCreateNArticle.Visible = true;
            //TextBox12.Text = (Convert.ToInt64(TextBox3.Text) + 1).ToString();
            TextBox16.Text = "15000";
            TextBox14.Text = "DIE ";
            TextBox14.Focus();
            //TextBox14.Text = TextBox14.Text.Length - 1;
            TextBox17.Text            = "40";
            btnCreateNArticle.Enabled = false;

            //}
            //else
            //{
            //    string script = "alert('Last Article No. Not Available !!!')";
            //    System.Web.UI.ScriptManager.RegisterClientScriptBlock(btnCreateArt, this.GetType(), "Test", script, true);
            //}
            TextBox13.Text = "";
            //TextBox14.Text = "";
            TextBox15.Text = "";
            //TextBox17.Text = "";
            TextBox12.Text = "";
        }
 protected void TextBox13_TextChanged(object sender, System.EventArgs e)
 {
     try
     {
         float a = float.Parse(TextBox6.Text);
         float b = float.Parse(TextBox13.Text);
         TextBox16.Text = (a * b).ToString();
         TextBox14.Focus();
     }
     catch (Exception er)
     { }
 }
Example #3
0
        protected void LinkButton7_Click(object sender, EventArgs e)
        {
            // dodanie użytkownika
            Panel10.Visible         = true;
            Session["id_polecenia"] = "1";
            TextBox14.Text          = "";
            TextBox15.Text          = "";
            TextBox16.Text          = "";
            try
            {
                DropDownList1.DataBind();
                DropDownList1.SelectedIndex = 0;
            }
            catch
            { }

            TextBox14.Focus();
            LinkButton20.Visible = false;
        }
Example #4
0
 protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
 {
     // edycja użytkownika
     try
     {
         TextBox15.Text = GridView1.SelectedDataKey[2].ToString();
         TextBox16.Text = GridView1.SelectedDataKey[2].ToString();
         TextBox14.Text = GridView1.SelectedDataKey[1].ToString();
         TextBox17.Text = GridView1.SelectedDataKey[3].ToString();
         TextBox18.Text = GridView1.SelectedDataKey[4].ToString();
         DropDownList1.SelectedIndex = DropDownList1.SelectedIndex = DropDownList1.Items.IndexOf(DropDownList1.Items.FindByValue(GridView1.SelectedDataKey[5].ToString()));
         Session["id_polecenia"]     = "2";
         Session["id_osoby"]         = GridView1.SelectedDataKey[0].ToString();
         Panel10.Visible             = true;
         TextBox14.Focus();
         LinkButton20.Visible = true;
     }
     catch
     { }
 }
        protected void btnCreateArt_Click(object sender, EventArgs e)
        {
            if (TextBox13.Text != "" && TextBox14.Text != "" && TextBox15.Text != "" && TextBox16.Text != "" && TextBox17.Text != "")
            {
                if (TextBox1.Text == "494901" || TextBox1.Text == "343401")
                {
                    LastArtice();
                }

                else
                {
                    OleDbCommand cmd1 = con.CreateCommand();
                    con.Open();
                    cmd1 = new OleDbCommand("SELECT DISTINCTROW CodArt FROM [Artículos de clientes] WHERE CodArtCli = '" + TextBox1.Text + "' ORDER BY [Artículos de clientes].CodArt DESC", con);
                    //OleDbDataAdapter oldA = new OleDbDataAdapter(cmd);
                    //DataTable dt = new DataTable();
                    //oldA.Fill(dt);

                    OleDbDataReader reader = cmd1.ExecuteReader();
                    if (reader.Read())
                    {
                        if (reader.FieldCount > 0)
                        {
                            TextBox12.Text = (Convert.ToInt64(reader["CodArt"]) + 1).ToString();
                        }
                        if (reader["CodArt"].ToString().StartsWith("0"))
                        {
                            TextBox12.Text = "0" + TextBox12.Text;
                        }
                    }

                    else
                    {
                        TextBox12.Text = TextBox1.Text + "00001";
                    }
                    con.Close();
                }
                //LastArtice();

                OleDbCommand cmd = con.CreateCommand();
                con.Open();
                cmd = new OleDbCommand("Insert into [Artículos de clientes] (CodArt, NomArt, Precio, PlaArt, Descuento, FamPie, CodArtCli) Values ('" + TextBox12.Text + "', '" + TextBox14.Text + "', " + TextBox15.Text + ", '" + TextBox13.Text + "', " + TextBox17.Text + ", '" + TextBox16.Text + "', '" + HiddenField1.Value + "') ", con);
                cmd.ExecuteNonQuery();
                con.Close();
                AddNewRecordRowToGrid();
                //btnCreateArt.Enabled = false;
                string script = "alert('Article Created Successfully !!!')";
                System.Web.UI.ScriptManager.RegisterClientScriptBlock(btnCreateArt, this.GetType(), "Test", script, true);
                //btnCreateArt.Enabled = true;
                //TextBox12.Text = (Convert.ToInt64(TextBox12.Text) + 1).ToString();
                TextBox14.Focus();
                TextBox13.Text = "";
                TextBox14.Text = "DIE ";
                TextBox15.Text = "";
                //TextBox16.Text = "";
                //TextBox17.Text = "";
            }
            else
            {
                string script = "alert('Plz Fill All The Fields Properly !!!')";
                System.Web.UI.ScriptManager.RegisterClientScriptBlock(btnCreateArt, this.GetType(), "Test", script, true);
            }
        }
Example #6
0
 void cb_Executed(object sender, ExecutedRoutedEventArgs e)
 {
     TextBox14.Clear();
     e.Handled = true;
 }