private void txt_model_TextChanged(object sender, EventArgs e) { var item = itemRepository.GetItem(txt_model.Text); _item_id = item.Id; txt_brand.Text = item.Brand; cb_category.SelectedValue = Convert.ToInt32(item.CategoryId); cb_sub_category.SelectedValue = Convert.ToInt32(item.SubCategoryId); checkbox_has_serial.Checked = item.HasSerial == 1; EnableDisableControl(item.Id == 0); //if (item.Id == 0) { // _receipt_model = null; // _serial_list = null; //} }
private void GetItem() { Items items = itemRepository.GetItem(txt_model.Text); if (items.Id > 0) { _item_id = items.Id; ItemRequiresSerial(items.HasSerial == 1); } lbl_serial_required.Visible = items.Id > 0; lbl_item_not_found.Visible = _item_id == 0; if (txt_model.Text.Length == 0) { lbl_item_not_found.Visible = false; } }