// display image in IMG_customer private void Lst_images_SelectionChanged(object sender, SelectionChangedEventArgs e) { try { if (sender != null) { SectionData.StartAwait(grid_main); } if (lst_images.SelectedIndex != -1) { docId = (int)lst_images.SelectedValue; docImgModel = imageList.ToList().Find(c => c.id == docId); tb_name.Text = docImgModel.docName; tb_notes.Text = docImgModel.note; string imageName = docImgModel.image; getImg(imageName); } if (sender != null) { SectionData.EndAwait(grid_main); } } catch (Exception ex) { if (sender != null) { SectionData.EndAwait(grid_main); } SectionData.ExceptionMessage(ex, this); } }
private async Task refreshDocCount(int inventoryId) { DocImage doc = new DocImage(); int docCount = await doc.GetDocCount("Inventory", inventoryId); int previouseCount = 0; if (md_docImage.Badge != null && md_docImage.Badge.ToString() != "") { previouseCount = int.Parse(md_docImage.Badge.ToString()); } if (docCount > 9) { docCount = 9; md_docImage.Badge = "+" + docCount.ToString(); } else if (docCount == 0) { md_docImage.Badge = ""; } else { md_docImage.Badge = docCount.ToString(); } }
private void clear() { tb_name.Clear(); tb_notes.Clear(); openFileDialog.FileName = ""; docImgModel = new DocImage(); SectionData.clearValidate(tb_name, p_errorName); SectionData.clearImg(img_upload); }