Exemplo n.º 1
0
 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);
            }
        }
Exemplo n.º 3
0
        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);
            }
        }
Exemplo n.º 5
0
 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);
     }
 }
Exemplo n.º 6
0
 public frmProductFeatures()
 {
     InitializeComponent();
     cls = new FeatureBussines();
 }