Beispiel #1
0
        private async Task RefreshLables()
        {
            try
            {
                var allBuilding = await BuildingBussines.DbCount(Guid.Empty, 0);

                var myBuilding = await BuildingBussines.DbCount(UserBussines.CurrentUser.Guid, 0);

                var rahn = await BuildingBussines.DbCount(Guid.Empty, 1);

                var foroush = await BuildingBussines.DbCount(Guid.Empty, 2);

                var allReq = await BuildingRequestBussines.DbCount(Guid.Empty);

                var myReq = await BuildingRequestBussines.DbCount(UserBussines.CurrentUser.Guid);

                var myCon = await ContractBussines.DbCount(UserBussines.CurrentUser.Guid);

                var disCharge = await ContractBussines.DischargeDbCount();

                BirthdayList = await PeoplesBussines.GetAllBirthDayAsync(Calendar.MiladiToShamsi(DateTime.Now));

                var minDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 0, 0, 0);
                var maxDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 23, 59, 59);

                allNote = await NoteBussines.GetAllAsync();

                allNote = allNote.Where(q =>
                                        q.DateSarresid != null && q.DateSarresid >= minDate &&
                                        q.DateSarresid <= maxDate)
                          .ToList();

                Invoke(new MethodInvoker(() =>
                {
                    lblAllBiulding.Text = allBuilding.ToString();
                    lblMyBuilding.Text  = myBuilding.ToString();
                    lblAllRahn.Text     = rahn.ToString();
                    lblAllForoush.Text  = foroush.ToString();
                    lblAllRequest.Text  = allReq.ToString();
                    lblMyRequest.Text   = myReq.ToString();
                    lblMyContract.Text  = myCon.ToString();
                    lblBirthday.Text    = BirthdayList.Count.ToString();
                    lblNotes.Text       = allNote.Count.ToString();
                    //lblReceptionCheck.Text = receptionCheck.ToString();
                    //lblPardakhtCheck.Text = pardakhtCheck.ToString();
                    lblSarresidEjare.Text    = disCharge.ToString();
                    btnBirthday.Enabled      = BirthdayList.Count != 0;
                    btnReminderNotes.Enabled = allNote.Count != 0;
                    //btnReceptionCheck.Enabled = receptionCheck != 0;
                    //btnPardakhtCheck.Enabled = pardakhtCheck != 0;
                    btnDischarge.Enabled = disCharge != 0;
                }));
            }
            catch (Exception ex)
            {
                WebErrorLog.ErrorInstence.StartErrorLog(ex);
            }
        }
Beispiel #2
0
        private async Task SetDataAsync()
        {
            try
            {
                var bu = await BuildingBussines.DbCount(Guid.Empty, 0);

                var req = await BuildingRequestBussines.DbCount(Guid.Empty);

                lblBuildingCount.Text = bu.ToString();
                lblRequestCount.Text  = req.ToString();
            }
            catch (Exception ex)
            {
                WebErrorLog.ErrorInstence.StartErrorLog(ex);
            }
        }