示例#1
0
        private void cboPreSupp_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cboPreSupp.SelectedIndex == -1)
            {
                return;
            }

            //display Stock details
            // txtSuppID.Text = preSupplier.getSuppID().ToString("000");
            //display Stock details
            txtSuppID.Text = cboPreSupp.Text.Substring(0, 3);

            DataSet ds = new DataSet();

            ds = CD.getSuppCDs(ds, Convert.ToInt32(txtSuppID.Text));
            string testData = "";

            for (int i = 0; i < ds.Tables["ss"].Rows.Count; i++)
            {
                Font font1 = new Font(FontFamily.GenericMonospace.Name, 9);
                cbopreordCD.Font = font1;

                //testData = ds.Tables[0].Rows[i][0].ToString().PadLeft(5, '0')+" "+ ds.Tables[0].Rows[i][1].ToString().Trim().PadRight(30)+"X";
                //MessageBox.Show(testData);
                //cbopreordCD.Items.Add(testData);
                cbopreordCD.Items.Add(String.Format("{0:00000} {1,-30} {2,5}", ds.Tables[0].Rows[i][0], ds.Tables[0].Rows[i][1].ToString(), ds.Tables[0].Rows[i][5].ToString()));

                //cbopreordCD.Items.Add(String.Format(ds.Tables[0].Rows[i][0].ToString().PadLeft(5, '0') + " " + ds.Tables[0].Rows[i][1].ToString().PadRight(30, ' ') + " " + String.Format(ds.Tables[0].Rows[i][5].ToString(), "000.00")));
            }

            Supplier preSupplier = new Supplier();

            preSupplier.getSupp(Convert.ToInt32(cboPreSupp.Text.Substring(0, 3)));

            if (preSupplier.getSuppID().Equals(0))
            {
                MessageBox.Show("No details found", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            grpPreorderCD.Visible = true;
        }
示例#2
0
        private void cboPreSupp_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cboPreSupp.SelectedIndex == -1)
            {
                return;
            }

            //display Stock details
            // txtSuppID.Text = preSupplier.getSuppID().ToString("000");
            //display Stock details
            txtSuppID.Text = cboPreSupp.Text.Substring(0, 3);

            DataSet ds = new DataSet();

            ds = CD.getSuppCDs(ds, Convert.ToInt32(txtSuppID.Text));

            for (int i = 0; i < ds.Tables["ss"].Rows.Count; i++)
            {
                cbopreordCD.Items.Add(ds.Tables[0].Rows[i][0].ToString().PadLeft(5, '0') + " " + ds.Tables[0].Rows[i][1].ToString().PadRight(30, ' ') + " " + String.Format(ds.Tables[0].Rows[i][5].ToString(), "000.00"));
            }


            Supplier preSupplier = new Supplier();

            preSupplier.getSupp(Convert.ToInt32(cboPreSupp.Text.Substring(0, 3)));

            if (preSupplier.getSuppID().Equals(0))
            {
                MessageBox.Show("No details found", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }



            grpPreorderCD.Visible = true;
        }