public frmProductFeatures(Guid guid, bool isShowMode) { InitializeComponent(); cls = FeatureBussines.Get(guid); grpAccount.Enabled = !isShowMode; btnFinish.Enabled = !isShowMode; }
private async void mnuDelete_Click(object sender, EventArgs e) { try { if (DGrid.RowCount <= 0) { return; } if (DGrid.CurrentRow == null) { return; } var guid = (Guid)DGrid[dgGuid.Index, DGrid.CurrentRow.Index].Value; if (MessageBox.Show($@"آیا از حذف {DGrid[dgName.Index, DGrid.CurrentRow.Index].Value} اطمینان دارید؟", "حذف", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) { return; } var prd = await FeatureBussines.GetAsync(guid); var res = await prd.RemoveAsync(); if (res.HasError) { frmNotification.PublicInfo.ShowMessage(res.ErrorMessage); return; } frmLoading.PublicInfo.ShowForm(); await LoadData(txtSearch.Text); } catch (Exception ex) { WebErrorLog.ErrorInstence.StartErrorLog(ex); } }
private async Task LoadFeatures() { try { var list = await FeatureBussines.GetAllAsync(); FeaturesBindingSource.DataSource = list.OrderBy(q => q.Title).ToList(); } catch (Exception ex) { WebErrorLog.ErrorInstence.StartErrorLog(ex); } }
private async Task LoadData(string search = "") { try { var liat = await FeatureBussines.GetAllAsync(search); ProductBindingSource.DataSource = liat.OrderBy(q => q.Title).ToSortableBindingList(); } catch (Exception ex) { WebErrorLog.ErrorInstence.StartErrorLog(ex); } }
public static WebFeature Get(Guid guid) { try { var prd = FeatureBussines.Get(guid); var mapList = Mappings.Default.Map <WebFeature>(prd); return(mapList); } catch (Exception ex) { WebErrorLog.ErrorInstence.StartErrorLog(ex); return(null); } }
public frmProductFeatures() { InitializeComponent(); cls = new FeatureBussines(); }