Esempio n. 1
0
    protected void StepEnter_Click(object sender, EventArgs e)
    {
        //IframePdf.Attributes.Add("src", "Drawing.aspx?UID=" + UIDTextBox.Text + "&Article=" + ArticleTextBox.Text + "&Passcode=Anu");

        if (StepTextBox.Text != "")
        {
            ////OleDbConnection con = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " + Server.MapPath("~/test/Access//Tablas.mdb"));
            con.Open();
            OleDbDataAdapter ad1 = new OleDbDataAdapter("SELECT  Operac FROM  [Fases estandards] WHERE NumFas = " + StepTextBox.Text + "  ", con);
            DataTable        dt  = new DataTable();
            ad1.Fill(dt);

            if (dt.Rows.Count > 0)
            {
                OperationTextBox.Text = dt.Rows[0][0].ToString();
                OleDbDataAdapter adnew = new OleDbDataAdapter("SELECT SUM(CanPie) FROM  [Ordenes de fabricación (historia/taller)] WHERE NumOrd = " + UIDTextBox.Text + " AND NumFas =" + StepTextBox.Text + "  ", con);
                DataTable        dtnew = new DataTable();
                adnew.Fill(dtnew);
                con.Close();
                if (dtnew.Rows.Count > 0 && dtnew.Rows[0][0].ToString() != "")
                {
                    FinishedTextBox.Text = dtnew.Rows[0][0].ToString();
                }
                else
                {
                    FinishedTextBox.Text = "0";
                }



                PendingTextBox.Text = Convert.ToString(Convert.ToInt32(OrderQtyTextbox.Text) - Convert.ToInt32(FinishedTextBox.Text));



                MachineNumTextBox.Focus();
            }


            else
            {
                StepTextBox.Focus();
            }
        }
    }
Esempio n. 2
0
    protected void MachineNumEnter_Click(object sender, EventArgs e)
    {
        if (MachineNumTextBox.Text != "")
        {
            MachineTextBox.Text = "";
            //OleDbConnection con = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " + Server.MapPath("~/test/Access//Tablas.mdb"));


            con.Open();
            OleDbDataAdapter ad1 = new OleDbDataAdapter("SELECT  TipMaq FROM  [Máquinas] WHERE CodMaq = " + MachineNumTextBox.Text + "  ", con);
            DataTable        dt  = new DataTable();
            ad1.Fill(dt);
            con.Close();


            if (dt.Rows.Count > 0)
            {
                MachineTextBox.Text = dt.Rows[0][0].ToString();

                if (File.Exists(Server.MapPath("~/MachinePhotos/" + MachineNumTextBox.Text + ".jpg")))
                {
                    MachineImage2.ImageUrl = "~/MachinePhotos/" + MachineNumTextBox.Text + ".jpg";
                }
                else
                {
                    MachineImage2.ImageUrl = "~/MachinePhotos/MachineImage.jpg";
                }
            }


            AcceptButton1.Focus();
        }
        else
        {
            //string script = "alert('Please Enter Valid Machine No....!!!')";
            //System.Web.UI.ScriptManager.RegisterClientScriptBlock(MachineNumEnter, this.GetType(), "Test", script, true);
            MachineNumTextBox.Focus();
        }
    }