private void EnrichTextbox(string receivedData) { using (var context = new Model()) { var baseDataDictionaryDetail = context.Base_DataDictionaryDetail.FirstOrDefault(s => s.DataDictionaryDetailId == receivedData); if (baseDataDictionaryDetail != null) { BeginInvoke(new Action((() => { ShelvesIdTxt.Clear(); ShelvesNameTxt.Clear(); }))); BeginInvoke(new Action((() => { ShelvesIdTxt.Text = _baseDataDictionaryDetail.Code; ShelvesNameTxt.Text = _baseDataDictionaryDetail.FullName; }))); _baseDataDictionaryDetail = baseDataDictionaryDetail; } var aPlanProductInfomation = context.A_PlanProductInfomation.FirstOrDefault(s => s.IsAvailable == true && s.ProductBornCode == receivedData); if (aPlanProductInfomation != null) { BeginInvoke(new Action((() => { ProductNameTxt.Clear(); ProductBornCodeTxt.Clear(); }))); _aPlanProductInfomation = aPlanProductInfomation; BeginInvoke(new Action((() => { ProductNameTxt.Text = aPlanProductInfomation.ProductName; ProductBornCodeTxt.Text = aPlanProductInfomation.ProductBornCode; }))); } } }
private void EnrichTextbox(string receivedData) { using (var context = new Model()) { BeginInvoke(new Action((() => { ProductNameTxt.Clear(); ProductBornCodeTxt.Clear(); }))); var aPlanProductInfomation = context.A_PlanProductInfomation.FirstOrDefault(s => s.IsAvailable == true && s.ProductBornCode == receivedData); if (aPlanProductInfomation != null) { _aPlanProductInfomation = aPlanProductInfomation; BeginInvoke(new Action((() => { ProductNameTxt.Text = aPlanProductInfomation.ProductName; ProductBornCodeTxt.Text = aPlanProductInfomation.ProductBornCode; }))); } } }