Exemple #1
0
        private async Task LoadData(AdvertiseType type, string search = "")
        {
            try
            {
                if (type == AdvertiseType.Divar)
                {
                    var list = await DivarCityBussines.GetAllAsync(search);

                    DivarBindingSource.DataSource = list.OrderBy(q => q.Name).Where(q => q.Status).ToList();
                    lblCounter.Text = DivarBindingSource.Count.ToString();
                }

                else if (type == AdvertiseType.Sheypoor)
                {
                    var list = await SheypoorCityBussines.GetAllAsync(search);

                    SheypoorBindingSource.DataSource = list.OrderBy(q => q.Name).Where(q => q.Status).ToList();
                    lblCounter.Text = SheypoorBindingSource.Count.ToString();
                }
            }
            catch (Exception e)
            {
                WebErrorLog.ErrorInstence.StartErrorLog(e);
            }
        }
Exemple #2
0
        private async void picCity_Click(object sender, EventArgs e)
        {
            try
            {
                var allcit = await DivarCityBussines.GetAllAsync();

                if (allcit.Count > 0)
                {
                    if (FarsiMessegeBox.Show(
                            "شهرهای دیوار پیش از این مقداردهی شده اند در صورت ادامه باید تمامی تنظیمات سیمکارت ها و آگهی ها دوباره انجام دهید. آیا ادامه میدهید؟.",
                            "هشدار", FMessegeBoxButtons.YesNo, FMessegeBoxIcons.Information) == DialogResult.No)
                    {
                        return;
                    }
                }
                var divar = await DivarAdv.GetInstance();

                var list = divar.GetAllCityFromDivar();
                await DivarCityBussines.SaveAsync(list);
                await DivarRegion(list.Count);
                await SheypoorCity();

                Utility.CloseAllChromeWindows();
            }
            catch (Exception exception)
            {
                WebErrorLog.ErrorInstence.StartErrorLog(exception);
            }
        }
Exemple #3
0
        private async void Form1_Load(object sender, EventArgs e)
        {
            //Fill Number ComboBox
            var list1 = await SimcardBussines.GetAllAsync();
            SimcardBindingSource.DataSource = list1;

            //Fill Ads To Grid
            //var list2 = await Advertise.GetAllAsync("D:\\DivarTest");
            //SimcardAdvBindingSource.DataSource = list2;

            //Fill Divar City To Grid
            var list3 = await DivarCityBussines.GetAllAsync();
            divarCityBussinesBindingSource.DataSource = list3.ToList();
        }
Exemple #4
0
        private async Task FillCity()
        {
            try
            {
                var list3 = await DivarCityBussines.GetAllAsync();

                cityBindingSource.DataSource = list3.ToList();

                var list4 = await SheypoorCityBussines.GetAllAsync();

                SheypoorCityBindingSource.DataSource = list4;
            }
            catch (Exception e)
            {
                WebErrorLog.ErrorInstence.StartErrorLog(e);
            }
        }
Exemple #5
0
        private void FillComboBox()
        {
            try
            {
                Invoke(new MethodInvoker(async() =>
                {
                    var list = await SimcardBussines.GetAllAsync();
                    var a    = list.Select(q => q.Operator).Distinct().ToList();
                    cmbOperator.DataSource = a;

                    var divarCat1 = await AdvCategoryBussines.GetAllAsync(Guid.Empty, AdvertiseType.Divar);
                    divarCat1     = divarCat1.OrderBy(q => q.Name).ToList();
                    PostCat1BindingSource.DataSource = divarCat1;


                    var dCity = await DivarCityBussines.GetAllAsync();
                    dCity     = dCity.OrderBy(q => q.Name).ToList();
                    DivarCBindingSource.DataSource = dCity;
                    cmbDivarCity.SelectedIndex     = 0;

                    var shCity = await SheypoorCityBussines.GetAllAsync();
                    shCity     = shCity.OrderBy(q => q.Name).ToList();
                    SheypoorCBindingSource.DataSource = shCity;
                    cmbSheypoorCity.SelectedIndex     = 0;

                    var divarChat1 = await AdvCategoryBussines.GetAllAsync(Guid.Empty, AdvertiseType.Divar);
                    divarChat1     = divarChat1.OrderBy(q => q.Name).ToList();
                    DivarChatBindingSource1.DataSource = divarChat1;

                    var sheypoorChat1 = await AdvCategoryBussines.GetAllAsync(Guid.Empty, AdvertiseType.Sheypoor);
                    sheypoorChat1     = sheypoorChat1.OrderBy(q => q.Name).ToList();
                    SheypoorChatBindingSource1.DataSource = sheypoorChat1;

                    var postCity = await DivarCityBussines.GetAllAsync();
                    postCity     = postCity.OrderBy(q => q.Name).ToList();
                    PostCityBindingSource.DataSource = postCity;
                    cmbPostCity.SelectedIndex        = 0;
                }));
            }
            catch (Exception e)
            {
                WebErrorLog.ErrorInstence.StartErrorLog(e);
            }
        }
        private async Task LoadCity()
        {
            try
            {
                var a = new DivarCityBussines()
                {
                    Guid = Guid.Empty,
                    Name = "[همه]"
                };
                var list = await DivarCityBussines.GetAllAsync();

                list.Add(a);
                CityBindingSource.DataSource = list.ToList().OrderBy(q => q.Name);
            }
            catch (Exception e)
            {
                WebErrorLog.ErrorInstence.StartErrorLog(e);
            }
        }