Ejemplo n.º 1
0
        private void btnEqui_search_Click(object sender, EventArgs e)
        {
            if (validateRepItem_search())
            {
                Buisness_Logic.repairablerable_Items     prd   = new Buisness_Logic.repairablerable_Items();
                Buisness_Logic.repairableItem_repository rirep = new Buisness_Logic.repairableItem_repository();


                bool x = rirep.searchEqui_Items((string.IsNullOrEmpty(txtEqui_code.Text) ? 0 : int.Parse(txtEqui_code.Text)), txtEqui_name.Text.ToString(), prd);
                if (x)
                {
                    MessageBox.Show("Record found.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    txtEqui_name.Text  = prd.name;
                    txtEqui_price.Text = prd.price.ToString();
                    txtEqui_make.Text  = prd.make.ToString();
                    txtEqui_Model.Text = prd.model;
                    txtEqui_code.Text  = prd.invID.ToString();

                    pictureBoxEqui.SizeMode = PictureBoxSizeMode.StretchImage;

                    MemoryStream ms = new MemoryStream(prd.photo);

                    ms.Read(prd.photo, 0, prd.photo.Length);
                    pictureBoxEqui.Image = Image.FromStream(ms);
                }
                else
                {
                    MessageBox.Show("No record found.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
Ejemplo n.º 2
0
 private void inventory_Load(object sender, EventArgs e)
 {
     if (radio_nonRep.Checked)
     {
         lblQty.Visible    = true;
         lblWeight.Visible = true;
         lblWeight.Refresh();
         lblQty.Refresh();
     }
     else if (radio_repItems.Checked)
     {
         lblQty.Visible    = false;
         lblWeight.Visible = false;
         lblWeight.Refresh();
         lblQty.Refresh();
     }
     Buisness_Logic.repairableItem_repository er = new Buisness_Logic.repairableItem_repository();
     dataGridINV1.DataSource = er.searchEqui_Items();
     this.dataGridINV1.Columns[5].Visible = false;
 }