public UjfHouseInspectionsAddChangeForm(long ordId, ObjectList<UjfApartmentHouseInspection> hil)
 {
     this.InitializeComponent();
     this.set_Font(Manager.WindowFont);
     this.orderId = ordId;
     this.HouseInspList = hil;
     this.inspectionStatusFasetData.Faset = FasetsEnum.UjfApartmentHouseInspectionStatus;
     this.inspectionStatusFasetData.RefreshValuesWithNull();
     this.inspectionStatusFasetData.SelectedFasetItem = FasetItem.Null;
     if ((hil != null) && (hil.get_Count() > 0))
     {
         this.dtpInspectionDate.Value = hil.get_Item(0).InspectionDateTime;
         if (hil.get_Item(0).StatusId != 0)
         {
             this.inspectionStatusFasetData.SelectedFasetItem = FasetItem.FindById(hil.get_Item(0).StatusId);
         }
         else
         {
             this.inspectionStatusFasetData.set_SelectedIndex(0);
         }
         this.tbInspector.set_Text(hil.get_Item(0).Inspector);
     }
 }
Exemplo n.º 2
0
 private void selectServiceTypes_Selected(ObjectList<ServiceTypeOld> list)
 {
     if ((list != null) && (list.get_Count() > 0))
     {
         this.selectServices.FilterServiceTypes = list.get_Item(0);
     }
     else
     {
         this.selectServices.FilterServiceTypes = null;
     }
 }
Exemplo n.º 3
0
 private void bckWrkrProcessSpliting_DoWork(object sender, DoWorkEventArgs e)
 {
     int num3;
     int num4;
     ObjectList<Apartment> list = new ObjectList<Apartment>();
     foreach (Apartment apartment in this.bsNewApartments)
     {
         list.Add(apartment);
     }
     ObjectList<Account> list2 = new ObjectList<Account>();
     foreach (Account account in this.bsNewAccounts)
     {
         list2.Add(account);
     }
     int num = System.Convert.ToInt32(this.numApartmentCount.Value);
     decimal[] numArray = new decimal[num];
     System.Collections.Generic.Dictionary<Apartment, ApartmentArea> dictionary = new System.Collections.Generic.Dictionary<Apartment, ApartmentArea>(num);
     string[] strArray = new string[num];
     int index = 0;
     foreach (System.Windows.Forms.DataGridViewRow row in (System.Collections.IEnumerable) this.dgvAccounts.Rows)
     {
         numArray[index] = System.Convert.ToDecimal(row.Cells.get_Item("clmnShare").get_Value());
         ApartmentArea area = new ApartmentArea {
             Total = System.Convert.ToDecimal(row.Cells.get_Item("clmnTotalSquare").get_Value()),
             Living = System.Convert.ToDecimal(row.Cells.get_Item("clmnLivingSquare").get_Value()),
             Heating = System.Convert.ToDecimal(row.Cells.get_Item("clmnHeatingSquare").get_Value()),
             Balcony = System.Convert.ToDecimal(row.Cells.get_Item("clmnBalconySquare").get_Value())
         };
         dictionary.Add(list.get_Item(index), area);
         strArray[index] = (row.Cells.get_Item("clmnFlatName").get_Value() == null) ? string.Empty : row.Cells.get_Item("clmnFlatName").get_Value().ToString();
         index = (int) (index + 1);
     }
     System.Collections.Generic.List<ObjectList<ApartmentResident>> list3 = new System.Collections.Generic.List<ObjectList<ApartmentResident>>(num);
     for (index = 0; index < num; index = (int) (index + 1))
     {
         list3.Add(new ObjectList<ApartmentResident>());
     }
     foreach (System.Windows.Forms.DataGridViewRow row2 in (System.Collections.IEnumerable) this.dgvNewApartmentResidents.Rows)
     {
         if (int.TryParse(row2.Cells.get_Item("clmnNumberAprtment").get_Value().ToString(), ref num3))
         {
             list3.get_Item((int) (num3 - 1)).Add(this.bsNewApartmentResidents.get_Item(this.dgvNewApartmentResidents.Rows.IndexOf(row2)) as ApartmentResident);
         }
     }
     System.Collections.Generic.List<ObjectList<ApartmentEquipment>> list4 = new System.Collections.Generic.List<ObjectList<ApartmentEquipment>>(num);
     for (index = 0; index < num; index = (int) (index + 1))
     {
         list4.Add(new ObjectList<ApartmentEquipment>());
     }
     foreach (System.Windows.Forms.DataGridViewRow row3 in (System.Collections.IEnumerable) this.dgvNewApartmentEquipment.Rows)
     {
         if (int.TryParse(row3.Cells.get_Item("clmnApartmentNumberEq").get_Value().ToString(), ref num3))
         {
             list4.get_Item((int) (num3 - 1)).Add(this.bsNewApartmentEquipment.get_Item(this.dgvNewApartmentEquipment.Rows.IndexOf(row3)) as ApartmentEquipment);
         }
         else if (row3.Cells.get_Item("clmnApartmentNumberEq").get_Value().ToString() == "На все")
         {
             foreach (ObjectList<ApartmentEquipment> list5 in list4)
             {
                 list5.Add((this.bsNewApartmentEquipment.get_Item(this.dgvNewApartmentEquipment.Rows.IndexOf(row3)) as ApartmentEquipment).Clone<ApartmentEquipment>());
             }
         }
     }
     if ((this.cbCashlessAccounts.get_Enabled() && (this.cbCashlessAccounts.get_SelectedItem() != null)) && int.TryParse(this.cbCashlessAccounts.get_SelectedItem().ToString(), ref num4))
     {
         num4 = (int) (num4 - 1);
     }
     else
     {
         num4 = -1;
     }
     try
     {
         object[] objArray = new object[] { this.m_OldAccount, this.dtpSplitDate.Value, list, list2, this.m_NewApartmentOwners, list3, list4, numArray, dictionary, strArray, (int) num4, this._apartmentOwnerLinks, this._apartmentResidentLinks, this._equipmentLinks, this.m_AccountHouseHolders };
         base.Invoke(this.SplitApartment, objArray);
         e.set_Result(null);
     }
     catch (System.Exception exception)
     {
         e.set_Result(exception);
     }
 }
Exemplo n.º 4
0
 public static ObjectList<AIS.SN.Model.DomainObjects.Views.ExchangeRequestAddress> GetByStatus(ExchangeStatus status, Area filterArea)
 {
     System.Collections.Generic.List<long> addresses = new System.Collections.Generic.List<long>();
     ObjectList<ExchangeRequest> exchangeRequestsGroup = ExchangeRequest.GetExchangeRequestsGroup(ExchangeRequestType.Address, status);
     ObjectList<AIS.SN.Model.DomainObjects.Views.ExchangeRequestAddress> list3 = new ObjectList<AIS.SN.Model.DomainObjects.Views.ExchangeRequestAddress>();
     foreach (ExchangeRequest request in exchangeRequestsGroup)
     {
         AIS.SN.Model.DomainObjects.Views.ExchangeRequestAddress address = Serializer.FromXml<AIS.SN.Model.DomainObjects.Views.ExchangeRequestAddress>(request.XmlIn);
         address.DateIn = request.DateIn;
         address.ExchangeRequestId = request.Id;
         address.LocalAddressId = request.AddressId;
         if (address.LocalAddressId != LocalAddress.Null.Id)
         {
             addresses.Add(address.LocalAddressId);
         }
         address.Address = string.Concat((string[]) new string[] { ((address.LastChangeDate != Constants.NullDate) ? ((string) address.LastChangeDate.ToShortDateString()) : ((string) address.DateIn.ToShortDateString())), ";", address.StreetSocr, " ", address.Street, ";", address.HouseSocr, " ", address.House, ";", address.FlatSocr, " ", address.Flat });
         list3.Add(address);
     }
     ObjectList<AIS.SN.Model.DomainObjects.Views.ExchangeRequestAddress> list4 = new ObjectList<AIS.SN.Model.DomainObjects.Views.ExchangeRequestAddress>();
     if ((filterArea == null) || (filterArea == Area.Null))
     {
         return list3.ApplySort("Address");
     }
     Area lhs = new Area {
         StatusTemporary = 1
     };
     lhs.SaveChanges();
     lhs.SaveAddresses(addresses);
     System.Collections.Generic.IList<long> filteredApartmentLocalAddresses = Area.GetFilteredApartmentLocalAddresses(lhs, filterArea);
     for (int i = 0; i < list3.get_Count(); i = (int) (i + 1))
     {
         long num2 = (list3.get_Item(i).RemoteAddressId == 0L) ? list3.get_Item(i).LocalAddressId : list3.get_Item(i).RemoteAddressId;
         if (filteredApartmentLocalAddresses.Contains(num2))
         {
             list4.Add(list3.get_Item(i));
         }
     }
     return list4.ApplySort("Address");
 }
 private void selectServices_OnServicesSelected(ObjectList<ServiceOld> services)
 {
     ServiceOld @null = ServiceOld.Null;
     if (services.get_Count() != 0)
     {
         @null = services.get_Item(0);
     }
     this.UpdateServiceFields(@null);
 }
Exemplo n.º 6
0
        private void SplitApartmentForm_Load(object sender, System.EventArgs e)
        {
            this.set_Font(Manager.WindowFont);
            if (!base.get_DesignMode())
            {
                Account account;
                this.SplitApartment = new SplitApartmentDelegate(this.m_OldApartment.SplitApartment);
                this.tpZero.set_Text("0.Начало");
                this.tpFirst.set_Text("1.Лицевые счета");
                this.tpSecond.set_Text("2.Владельцы ПЖ");
                this.tpThird.set_Text("3.Проживающие");
                this.tpFourth.set_Text("4.Оборудование");
                this.tpLast.set_Text("5.Завершение");
                (this.dgvNewApartmentResidents.Columns.get_Item("clmnNumberAprtment") as System.Windows.Forms.DataGridViewComboBoxColumn).Items.Add("Выбыл");
                (this.dgvNewApartmentResidents.Columns.get_Item("clmnNumberAprtment") as System.Windows.Forms.DataGridViewComboBoxColumn).Items.Add("1");
                (this.dgvNewApartmentResidents.Columns.get_Item("clmnNumberAprtment") as System.Windows.Forms.DataGridViewComboBoxColumn).Items.Add("2");
                (this.dgvNewApartmentEquipment.Columns.get_Item("clmnApartmentNumberEq") as System.Windows.Forms.DataGridViewComboBoxColumn).Items.Add("Ликвидирован");
                (this.dgvNewApartmentEquipment.Columns.get_Item("clmnApartmentNumberEq") as System.Windows.Forms.DataGridViewComboBoxColumn).Items.Add("На все");
                (this.dgvNewApartmentEquipment.Columns.get_Item("clmnApartmentNumberEq") as System.Windows.Forms.DataGridViewComboBoxColumn).Items.Add("1");
                (this.dgvNewApartmentEquipment.Columns.get_Item("clmnApartmentNumberEq") as System.Windows.Forms.DataGridViewComboBoxColumn).Items.Add("2");
                (this.dgvAccounts.Columns.get_Item("clmnShare") as DataGridViewNumericColumn).DecimalPlaces = 3;
                (this.dgvAccounts.Columns.get_Item("clmnShare") as DataGridViewNumericColumn).Increment = 0.01M;
                (this.dgvAccounts.Columns.get_Item("clmnShare") as DataGridViewNumericColumn).DefaultValue = 0.5M;
                (this.dgvAccounts.Columns.get_Item("clmnShare") as DataGridViewNumericColumn).Minimum = 0M;
                (this.dgvAccounts.Columns.get_Item("clmnShare") as DataGridViewNumericColumn).Maximum = 1M;
                (this.dgvAccounts.Columns.get_Item("clmnTotalSquare") as DataGridViewNumericColumn).DecimalPlaces = 2;
                (this.dgvAccounts.Columns.get_Item("clmnTotalSquare") as DataGridViewNumericColumn).Increment = 1M;
                (this.dgvAccounts.Columns.get_Item("clmnTotalSquare") as DataGridViewNumericColumn).DefaultValue = 0M;
                (this.dgvAccounts.Columns.get_Item("clmnTotalSquare") as DataGridViewNumericColumn).Minimum = 0M;
                (this.dgvAccounts.Columns.get_Item("clmnTotalSquare") as DataGridViewNumericColumn).Maximum = 100000M;
                (this.dgvAccounts.Columns.get_Item("clmnLivingSquare") as DataGridViewNumericColumn).DecimalPlaces = 2;
                (this.dgvAccounts.Columns.get_Item("clmnLivingSquare") as DataGridViewNumericColumn).Increment = 1M;
                (this.dgvAccounts.Columns.get_Item("clmnLivingSquare") as DataGridViewNumericColumn).DefaultValue = 0M;
                (this.dgvAccounts.Columns.get_Item("clmnLivingSquare") as DataGridViewNumericColumn).Minimum = 0M;
                (this.dgvAccounts.Columns.get_Item("clmnLivingSquare") as DataGridViewNumericColumn).Maximum = 100000M;
                (this.dgvAccounts.Columns.get_Item("clmnHeatingSquare") as DataGridViewNumericColumn).DecimalPlaces = 2;
                (this.dgvAccounts.Columns.get_Item("clmnHeatingSquare") as DataGridViewNumericColumn).Increment = 1M;
                (this.dgvAccounts.Columns.get_Item("clmnHeatingSquare") as DataGridViewNumericColumn).DefaultValue = 0M;
                (this.dgvAccounts.Columns.get_Item("clmnHeatingSquare") as DataGridViewNumericColumn).Minimum = 0M;
                (this.dgvAccounts.Columns.get_Item("clmnHeatingSquare") as DataGridViewNumericColumn).Maximum = 100000M;
                (this.dgvAccounts.Columns.get_Item("clmnBalconySquare") as DataGridViewNumericColumn).DecimalPlaces = 2;
                (this.dgvAccounts.Columns.get_Item("clmnBalconySquare") as DataGridViewNumericColumn).Increment = 1M;
                (this.dgvAccounts.Columns.get_Item("clmnBalconySquare") as DataGridViewNumericColumn).DefaultValue = 0M;
                (this.dgvAccounts.Columns.get_Item("clmnBalconySquare") as DataGridViewNumericColumn).Minimum = 0M;
                (this.dgvAccounts.Columns.get_Item("clmnBalconySquare") as DataGridViewNumericColumn).Maximum = 100000M;
                if (this.m_OldAccount != Account.Null)
                {
                    account = this.m_OldAccount.Clone<Account>();
                    account.ApartmentId = Apartment.Null.Id;
                    account.Number = string.Empty;
                    account.FromDate = account.Created = System.DateTime.Now;
                    this.tbOldApartmentNumber.set_Text(this.m_OldApartment.Number);
                    this.tbOldApartmentAddress.set_Text(this.m_OldApartment.AddressName);
                    if (this.m_OldApartment.FromDate != System.DateTime.MinValue)
                    {
                        this.tbOldApartmentFromDate.set_Text(this.m_OldApartment.FromDate.ToLongDateString());
                    }
                    else
                    {
                        this.tbOldApartmentFromDate.set_Text("");
                    }
                    this.tbOldAccountNumber.set_Text(this.m_OldAccount.Number);
                    this.tbOldAccountOwnerName.set_Text(this.m_OldAccount.OwnerName);
                    this.tbOldAccountFromDate.set_Text(this.m_OldAccount.FromDate.ToLongDateString());
                    this.set_Text("Разделение паспорта жилья по адресу: " + this.m_OldApartment.AddressName);
                }
                else
                {
                    account = new Account();
                }
                this.m_NewApartmentOwners.Add(new ObjectList<ApartmentOwner>());
                this.m_NewApartmentOwners.Add(new ObjectList<ApartmentOwner>());
                foreach (ApartmentOwner owner in this.m_OldApartment.GetApartmentOwners())
                {
                    if ((owner.ToDate == System.DateTime.MinValue) || (owner.ToDate > System.DateTime.Now))
                    {
                        ApartmentOwner owner2 = owner.Clone<ApartmentOwner>();
                        owner2.FromDate = this.dtpSplitDate.Value;
                        owner2.Created = System.DateTime.Now;
                        this.m_NewApartmentOwners.get_Item(0).Add(owner2);
                        this._apartmentOwnerLinks.Add(owner2, owner);
                    }
                }
                ObjectList<Account> list2 = new ObjectList<Account>();
                list2.Add(account);
                Account account2 = new Account {
                    FromDate = this.dtpSplitDate.Value,
                    Created = System.DateTime.Now,
                    HouseHolderId = this.m_OldAccount.HouseHolderId,
                    NeedPrintNotice = this.m_OldAccount.NeedPrintNotice
                };
                list2.Add(account2);
                this.bsNewAccounts.set_DataSource(list2);
                ObjectList<Apartment> list3 = new ObjectList<Apartment> {
                    new Apartment(),
                    new Apartment()
                };
                foreach (Apartment apartment in list3)
                {
                    apartment.AdrId = this.m_OldApartment.AdrId;
                    apartment.HouseId = this.m_OldApartment.HouseId;
                    apartment.FloorHouse = this.m_OldApartment.FloorHouse;
                    apartment.DoorWay = this.m_OldApartment.DoorWay;
                }
                this.bsNewApartments.set_DataSource(list3);
                AccountHouseHolder holder = this.m_OldAccount.FindCurrentAccountHouseHolder().Clone<AccountHouseHolder>();
                holder.Code = 0;
                this.m_AccountHouseHolders.Add(list2.get_Item(0), (list2.get_Item(0).HouseHolderId > 0L) ? holder : new AccountHouseHolder());
                AccountHouseHolder holder2 = this.m_OldAccount.FindCurrentAccountHouseHolder().Clone<AccountHouseHolder>();
                holder2.Code = 0;
                this.m_AccountHouseHolders.Add(list2.get_Item(1), holder2);
                foreach (ApartmentResident resident in this.m_OldApartment.GetApartmentResidents())
                {
                    if ((resident.ToDate == System.DateTime.MinValue) || (resident.ToDate == System.DateTime.Now))
                    {
                        ApartmentResident resident2 = resident.Clone<ApartmentResident>();
                        resident2.FromDate = this.dtpSplitDate.Value;
                        resident2.Created = System.DateTime.Now;
                        resident2.ApartmentId = Apartment.Null.Id;
                        this.m_NewApartmentResidents.Add(resident2);
                        this._apartmentResidentLinks.Add(resident2, resident);
                    }
                }
                this.bsNewApartmentResidents.set_DataSource(this.m_NewApartmentResidents);
                foreach (ApartmentEquipment equipment in this.m_OldApartment.GetApartmentEquipments())
                {
                    if ((equipment.ToDate == System.DateTime.MinValue) || (equipment.ToDate == System.DateTime.Now))
                    {
                        ApartmentEquipment equipment2 = equipment.Clone<ApartmentEquipment>();
                        equipment2.ApartmentId = Apartment.Null.Id;
                        equipment2.Created = System.DateTime.Now;
                        equipment2.FromDate = this.dtpSplitDate.Value;
                        this.m_NewApartmentEquipment.Add(equipment2);
                        this._equipmentLinks.Add(equipment2, equipment);
                    }
                }
                this.bsNewApartmentEquipment.set_DataSource(this.m_NewApartmentEquipment);
                if (AccountCashlessProperty.FindByAccountNumber(this.m_OldAccount.Number) != AccountCashlessProperty.Null)
                {
                    this.cbCashlessAccounts.set_Enabled(true);
                    this.cbCashlessAccounts.Items.Add("Удаление");
                    this.cbCashlessAccounts.Items.Add("1");
                    this.cbCashlessAccounts.Items.Add("2");
                }
                switch (this.m_OldApartment.AddressLevel)
                {
                    case 30:
                        this.m_IsHouse = true;
                        break;

                    case 40:
                        this.m_IsHouse = false;
                        break;

                    default:
                        Messages.ShowError("Ошибка. Адрес разделяемого паспорта жилья не является ни домом, ни квартирой.");
                        base.Close();
                        break;
                }
                if (!this.m_IsHouse)
                {
                    string name = this.m_OldApartment.GetAdr().Name;
                    foreach (System.Windows.Forms.DataGridViewRow row in (System.Collections.IEnumerable) this.dgvAccounts.Rows)
                    {
                        row.Cells.get_Item("clmnFlatName").set_Value(name);
                    }
                }
                foreach (System.Windows.Forms.DataGridViewRow row2 in (System.Collections.IEnumerable) this.dgvAccounts.Rows)
                {
                    row2.Cells.get_Item("clmnTotalSquare").set_Value(this.m_OldTotalSquare / 2M);
                    row2.Cells.get_Item("clmnLivingSquare").set_Value(this.m_OldLivingSquare / 2M);
                    row2.Cells.get_Item("clmnHeatingSquare").set_Value(this.m_OldHeatingSquare / 2M);
                    row2.Cells.get_Item("clmnBalconySquare").set_Value(this.m_OldBalconySquare / 2M);
                }
                this.vwAccountSettings.SetAccount(this.bsNewAccounts.get_Current() as Account);
                this.vwAccountSettings.SetAccountHouseHolder(this.m_AccountHouseHolders[this.bsNewAccounts.get_Current() as Account]);
            }
        }
 public HouseCounterApartmentAddChangeForm(ObjectList<HouseCounterApartment> olHouseCounterApartment)
     : this()
 {
     this.ol_HouseCounterApartment = olHouseCounterApartment;
     this.m_HouseCounterApartment = olHouseCounterApartment.get_Item(0);
 }
Exemplo n.º 8
0
 public House GetHouseByAddressId()
 {
     ObjectList<House> list = new ObjectList<House>();
     if (this.AddressLevel == 40)
     {
         list = Mappers.HouseMapper.FindByAdrId(this.ParentAddrId);
     }
     else if (this.AddressLevel == 30)
     {
         list = Mappers.HouseMapper.FindByAdrId(this.AdrId);
     }
     if (list.get_Count() == 0)
     {
         return House.Null;
     }
     return list.get_Item(0);
 }
Exemplo n.º 9
0
 private void SelectedService(ObjectList<ServiceOld> list)
 {
     if (list.get_Count() > 0)
     {
         this.serviceProviderTree.ShowOrganizations(this.FindOrganizationsByService(list.get_Item(0)));
         this.TreeExpander(this.serviceProviderTree, list.get_Item(0));
     }
 }
Exemplo n.º 10
0
 private void butOplApply_Click(object sender, System.EventArgs e)
 {
     if (!this.IsBusy)
     {
         this.butOplApply.set_Enabled((bool) !(this.IsBusy = true));
         if (this.m_PrintPOS.IsBusy)
         {
             System.Windows.Forms.MessageBox.Show("Фискальный регистратор занят. " + System.Environment.get_NewLine() + "Дождитесь выполнения операции.");
             this.butOplApply.set_Enabled((bool) !(this.IsBusy = false));
         }
         else
         {
             User currentUser;
             this.Payments_Fill();
             ObjectList<SpPayment> payments = new ObjectList<SpPayment>();
             decimal num = 0M;
             decimal commission = 0M;
             PayPaymentMoreFixedSum sum = new PayPaymentMoreFixedSum();
             foreach (SpPayment payment2 in this.m_payments)
             {
                 if (!(payment2.Summ == 0M))
                 {
                     num += payment2.Summ;
                     commission += payment2.Commission;
                     SpPayment payment = new SpPayment {
                         AccountId = payment2.AccountId,
                         ServiceName = payment2.ServiceName,
                         Summ = payment2.Summ,
                         Commission = 0M
                     };
                     payments.Add(payment);
                 }
             }
             commission = decimal.Round(commission, 2);
             if (payments.get_Count() == 0)
             {
                 this.butOplApply.set_Enabled((bool) !(this.IsBusy = false));
                 throw new System.ApplicationException("Ошибка, нет ни одной услуги для оплаты, проверте суммы оплаты.");
             }
             payments.get_Item(0).Commission = commission;
             string cashierTerminal = Settings.Default.CashierTerminal;
             if (num >= PersonsCashSearchForm.FixedSumm)
             {
                 PersonsCashSearchForm form = new PersonsCashSearchForm();
                 if (form.ShowDialog() == System.Windows.Forms.DialogResult.Cancel)
                 {
                     base.Close();
                     return;
                 }
                 sum.PersonId = form.SelectPerson.Id;
             }
             try
             {
                 currentUser = User.GetCurrentUser();
                 currentUser.GetOrg();
             }
             catch (System.Exception)
             {
                 this.butOplApply.set_Enabled((bool) !(this.IsBusy = false));
                 throw new System.ApplicationException("Ошибка, проверьте настройки пользователя, организаций пункта приема и платежного агента.");
             }
             sum.UserId = currentUser.Id;
             PayLocalTransaction transaction = AccountOther.MakePaymentTry(payments, currentUser.Id, cashierTerminal);
             AccountOther.MakeCommit();
             if (num >= PersonsCashSearchForm.FixedSumm)
             {
                 sum.SpPaymentUno = transaction.Id;
                 sum.Summ = num;
                 sum.SaveChanges();
             }
             this.m_PrintPOS.AddToAccumulatePaySum(num, commission);
             this.m_PrintPOS.PrintPayment(this.m_Accounts.get_Item(0), payments, ((long) transaction.Id).ToString(), false, num, commission, false, delegate {
                 Messages.ShowMessage("Платеж успешно проведен.");
                 this.butOplApply.set_Enabled((bool) !(this.IsBusy = false));
                 base.Close();
             }, delegate {
                 Messages.ShowMessage("Платеж успешно проведен.");
                 this.butOplApply.set_Enabled((bool) !(this.IsBusy = false));
                 base.Close();
             });
         }
     }
 }
Exemplo n.º 11
0
 private void m_SearchWorker_DoWork(object sender, DoWorkEventArgs e)
 {
     ObjectList<Apartment> list = new ObjectList<Apartment>();
     if (this.m_SearchByNumbersRadio.get_Checked())
     {
         string apartmentNumber = this.m_ApartmentNumberEdit.get_Text().Trim();
         string accountNumber = this.m_AccountEdit.get_Text().Trim();
         list = Apartment.Search(apartmentNumber, accountNumber, LocalAddress.Null.Id, string.Empty, this.chxShowClose.get_Checked(), string.Empty);
         if (string.IsNullOrEmpty(apartmentNumber) && string.IsNullOrEmpty(accountNumber))
         {
             this.addressesSearch.Clear();
             for (int i = 0; i < LocalAddress.GetUserAddresses().get_Count(); i = (int) (i + 1))
             {
                 this.addressesSearch.Add(LocalAddress.GetUserAddresses().get_Item(i));
             }
         }
         if (!string.IsNullOrEmpty(apartmentNumber) || !string.IsNullOrEmpty(accountNumber))
         {
             if (list.get_Count() == 0)
             {
                 System.Windows.Forms.MessageBox.Show("По Вашему запросу не найдено адреса.", "Предупреждение", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Asterisk);
                 this.flag = true;
             }
             else
             {
                 this.addressesSearch.Clear();
                 this.addressesSearch.Add(LocalAddress.FindById(list.get_Item(0).AdrId));
             }
         }
     }
     else
     {
         LocalAddress selectedAddress = this.m_LocalAddressSelector.GetSelectedAddress();
         string ownerName = this.m_OwnerNameEdit.get_Text();
         if ((selectedAddress == LocalAddress.Null) && string.IsNullOrEmpty(ownerName))
         {
             list = Apartment.Search(string.Empty, string.Empty, LocalAddress.Null.Id, string.Empty, this.chxShowClose.get_Checked(), string.Empty);
             this.addressesSearch.Clear();
             for (int j = 0; j < LocalAddress.GetUserAddresses().get_Count(); j = (int) (j + 1))
             {
                 this.addressesSearch.Add(LocalAddress.GetUserAddresses().get_Item(j));
             }
         }
         else if ((selectedAddress != LocalAddress.Null) || !string.IsNullOrEmpty(ownerName))
         {
             list = Apartment.Search(string.Empty, string.Empty, selectedAddress.Id, ownerName, this.chxShowClose.get_Checked(), string.Empty);
             if (list.get_Count() == 0)
             {
                 System.Windows.Forms.MessageBox.Show("По Вашему запросу не найдено адреса.", "Предупреждение", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Asterisk);
                 this.flag = true;
             }
             else
             {
                 this.addressesSearch.Clear();
                 if (selectedAddress != LocalAddress.Null)
                 {
                     this.addressesSearch.Add(selectedAddress);
                 }
                 else
                 {
                     this.addressesSearch.Add(LocalAddress.FindById(list.get_Item(0).AdrId));
                 }
             }
         }
     }
     list.ApplySort("AddressName");
     e.set_Result(list);
 }