示例#1
0
        private void btnWli_search_Click(object sender, EventArgs e)
        {
            if (validateNonRepItem_search())
            {
                Buisness_Logic.nonRepairable_Item           prd    = new Buisness_Logic.nonRepairable_Item();
                Buisness_Logic.nonRepairableItem_repository nrirep = new Buisness_Logic.nonRepairableItem_repository();


                bool x = nrirep.searchWL_Items((string.IsNullOrEmpty(txtwl_code.Text) ? 0 : int.Parse(txtwl_code.Text)), txtwl_name.Text.ToString(), prd);
                if (x)
                {
                    MessageBox.Show("Record found.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    txtwl_name.Text   = prd.name;
                    txtwl_qty.Text    = prd.qty.ToString();
                    txtwl_price.Text  = prd.price.ToString();
                    txtwl_make.Text   = prd.make.ToString();
                    txtwl_weight.Text = prd.weight.ToString();
                    txtwl_model.Text  = prd.model;
                    txtwl_code.Text   = prd.invID.ToString();

                    picboxWli.SizeMode = PictureBoxSizeMode.StretchImage;

                    MemoryStream ms = new MemoryStream(prd.photo);

                    ms.Read(prd.photo, 0, prd.photo.Length);
                    picboxWli.Image = Image.FromStream(ms);
                }
                else
                {
                    MessageBox.Show("No record found.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }