Exemplo n.º 1
0
 private void dgvStatistic_CellDoubleClick(object sender, System.Windows.Forms.DataGridViewCellEventArgs e)
 {
     if (e.get_RowIndex() >= 0)
     {
         string name = this.dgvStatistic.Rows.get_Item(e.get_RowIndex()).Cells.get_Item(0).get_Value().ToString();
         FasetItem status = FasetItem.FindByName(FasetsEnum.PaymentReestrStatus, name);
         PayReesterRecordsForm form = new PayReesterRecordsForm(this.m_PayReester, status);
         base.Close();
         form.ShowDialog(base.ParentForm);
     }
 }
Exemplo n.º 2
0
 private void dgvDebtAccounts_CellEndEdit(object sender, System.Windows.Forms.DataGridViewCellEventArgs e)
 {
     try
     {
         if ((this.dgvDebtAccounts.Rows.get_Item(e.get_RowIndex()).Cells.get_Item("selected").get_Value() != null) && !((bool) this.dgvDebtAccounts.Rows.get_Item(e.get_RowIndex()).Cells.get_Item("selected").get_Value()))
         {
             this.m_Selected = false;
             this.tsbtnAllAccount.set_Text(this.m_Selected ? ((string) "Снять выделение") : ((string) "Выделить все"));
             this.tsbtnAllAccount.set_Image(this.m_Selected ? Resources.ARCHIVE : Resources.ENABLED);
             this.tsBtnSelectAll.set_Text(this.m_Selected ? ((string) "Снять выделение") : ((string) "Выделить все"));
             this.tsBtnSelectAll.set_Image(this.m_Selected ? Resources.ARCHIVE : Resources.ENABLED);
         }
     }
     catch (System.Exception)
     {
     }
 }
 private void dgvServices_CellClick(object sender, System.Windows.Forms.DataGridViewCellEventArgs e)
 {
     if ((this.Selected.get_Visible() && (this.dgvServices.Rows.GetRowCount(System.Windows.Forms.DataGridViewElementStates.Selected) == 1)) && ((e.get_RowIndex() != -1) && (this.dgvServices.Rows.get_Item(e.get_RowIndex()).Cells.get_Item("Selected").get_Value() != null)))
     {
         if ((bool) this.dgvServices.Rows.get_Item(e.get_RowIndex()).Cells.get_Item("Selected").get_Value())
         {
             this.tsbSelectedAll.set_Text("Снять выделение");
             this.tsbSelectedAll.set_Image(Resources.ARCHIVE);
         }
         else
         {
             this.tsbSelectedAll.set_Text("Выделить выбранные");
             this.tsbSelectedAll.set_Image(Resources.APPLY2);
         }
     }
 }
Exemplo n.º 4
0
 private void dgvHouseServiceTariffTypes_CellEndEdit(object sender, System.Windows.Forms.DataGridViewCellEventArgs e)
 {
     if (((e.get_RowIndex() >= 0) && (e.get_ColumnIndex() >= 0)) && (e.get_ColumnIndex() == this.NewTariffTypeRate.get_Index()))
     {
         decimal num;
         System.Windows.Forms.DataGridViewCell cell = this.dgvHouseServiceTariffTypes.Rows.get_Item(e.get_RowIndex()).Cells.get_Item(e.get_ColumnIndex());
         if (!decimal.TryParse((string) (cell.get_Value() as string), ref num))
         {
             Messages.ShowWarning("Введите корректное значение подчинённого тарифа");
             cell.set_Value(null);
         }
         if (this.EditPerformed != null)
         {
             this.EditPerformed(this, e);
         }
     }
 }
Exemplo n.º 5
0
 private void dgvAccountServices_CellFormatting(object sender, System.Windows.Forms.DataGridViewCellFormattingEventArgs e)
 {
     if (((this.dgvAccountServices.Columns.get_Item(e.get_ColumnIndex()) == this.serviceCodeDataGridViewTextBoxColumn) || (this.dgvAccountServices.Columns.get_Item(e.get_ColumnIndex()) == this.serviceShortName)) && (this.dgvAccountServices.Rows.get_Item(e.get_RowIndex()).Cells.get_Item("serviceShortName").get_Value().ToString() == "ИТОГО:"))
     {
         e.CellStyle.set_BackColor(RecalcTotalsColor);
     }
     else if ((this.dgvAccountServices.Columns.get_Item(e.get_ColumnIndex()) == this.diffChargeSumm) || (this.dgvAccountServices.Columns.get_Item(e.get_ColumnIndex()) == this.diffBenefitSumm))
     {
         decimal num = System.Convert.ToDecimal(e.get_Value());
         if (num > 0M)
         {
             e.CellStyle.set_BackColor(PositiveRecalcColor);
         }
         if (num < 0M)
         {
             e.CellStyle.set_BackColor(NegativeRecalcColor);
         }
         if (num == 0M)
         {
             e.CellStyle.set_BackColor(NormalRecalcColor);
         }
     }
     else
     {
         e.CellStyle.set_BackColor(NormalRecalcColor);
     }
 }
Exemplo n.º 6
0
 private void dgvNewApartmentResidents_CellDoubleClick(object sender, System.Windows.Forms.DataGridViewCellEventArgs e)
 {
     if ((this.bsNewApartmentResidents.get_Current() is ApartmentResident) && (e.get_RowIndex() >= 0))
     {
         this.tsBtnEditResident.PerformClick();
     }
 }
Exemplo n.º 7
0
 private void dgvApartmentOwners_CellDoubleClick(object sender, System.Windows.Forms.DataGridViewCellEventArgs e)
 {
     if ((this.bsNewApartmentOwners.get_Current() is ApartmentOwner) && (e.get_RowIndex() >= 0))
     {
         this.tsbChangeApartmentOwner.PerformClick();
     }
 }
 private void dgvHouses_CellEndEdit(object sender, System.Windows.Forms.DataGridViewCellEventArgs e)
 {
     if (((e.get_RowIndex() >= 0) && (e.get_ColumnIndex() >= 0)) && ((((e.get_ColumnIndex() == this.NewTotalSquare.get_Index()) || (e.get_ColumnIndex() == this.NewFloor.get_Index())) || ((e.get_ColumnIndex() == this.NewHeating.get_Index()) || (e.get_ColumnIndex() == this.NewLiving.get_Index()))) || (((e.get_ColumnIndex() == this.NewLivingMkd.get_Index()) || (e.get_ColumnIndex() == this.NewTotalMKd.get_Index())) || ((e.get_ColumnIndex() == this.NewTotalOi.get_Index()) || (e.get_ColumnIndex() == this.NewNotLivingMkd.get_Index())))))
     {
         decimal num;
         System.Windows.Forms.DataGridViewCell cell = this.dgvHouses.Rows.get_Item(e.get_RowIndex()).Cells.get_Item(e.get_ColumnIndex());
         if (!decimal.TryParse((string) (cell.get_Value() as string), ref num))
         {
             Messages.ShowWarning("Введите корректное значение площади");
             cell.set_Value(null);
         }
         this.btnSave.set_Enabled(this.ValidateSavingOptions());
     }
 }
Exemplo n.º 9
0
 private void dgvServiceTariffTypes_CellEndEdit(object sender, System.Windows.Forms.DataGridViewCellEventArgs e)
 {
     System.Windows.Forms.DataGridViewRow row = this.dgvServiceTariffTypes.Rows.get_Item(e.get_RowIndex());
     if (row != null)
     {
         object ob = row.Cells.get_Item(e.get_ColumnIndex()).get_Value();
         decimal num = this.ObjectParseDecimal(ref ob);
         row.Cells.get_Item(e.get_ColumnIndex()).set_Value(ob);
         bool flag = false;
         if (ob != null)
         {
             try
             {
                 if (!((bool) ob) && this.Selected.get_Visible())
                 {
                     ServiceTariffType type2 = row.get_DataBoundItem() as ServiceTariffType;
                     foreach (System.Data.DataRow row3 in this.dtServiceTariffTypes.Rows)
                     {
                         if (((((long) row3.get_Item("serviceTariffTypeId")) == type2.Id) && (((int) row3.get_Item("typeId")) == type2.TariffTypeId)) && (((long) row3.get_Item("serviceTariffId")) == type2.ServiceTariffId))
                         {
                             row3.Delete();
                             flag = true;
                             break;
                         }
                     }
                     return;
                 }
             }
             catch
             {
             }
             ServiceTariffType type3 = row.get_DataBoundItem() as ServiceTariffType;
             if (!flag)
             {
                 foreach (System.Data.DataRow row4 in this.dtServiceTariffTypes.Rows)
                 {
                     if (((((long) row4.get_Item("serviceTariffTypeId")) == type3.Id) && (((int) row4.get_Item("typeId")) == type3.TariffTypeId)) && (((long) row4.get_Item("serviceTariffId")) == type3.ServiceTariffId))
                     {
                         row4.set_Item("rate", num);
                         flag = true;
                     }
                 }
             }
             if (!flag)
             {
                 this.dtServiceTariffTypes.Rows.Add((object[]) new object[] { ((long) type3.Id), ((long) type3.ServiceTariffId), ((int) type3.TariffTypeId), num });
             }
             this.ColoringDGVServiceTariffType();
         }
         else if (!this.Selected.get_Visible())
         {
             ServiceTariffType type = row.get_DataBoundItem() as ServiceTariffType;
             foreach (System.Data.DataRow row2 in this.dtServiceTariffTypes.Rows)
             {
                 if (((long) row2.get_Item("serviceTariffTypeId")) == type.Id)
                 {
                     row2.Delete();
                     flag = true;
                     break;
                 }
             }
         }
     }
 }
Exemplo n.º 10
0
 private void dgvServices_CellContentClick(object sender, System.Windows.Forms.DataGridViewCellEventArgs e)
 {
     if (e.get_RowIndex() != -1)
     {
         System.Windows.Forms.DataGridViewRow row = this.dgvServices.Rows.get_Item(e.get_RowIndex());
         if (row != null)
         {
             object ob = row.Cells.get_Item(e.get_ColumnIndex()).get_Value();
             this.ObjectParseDecimal(ref ob);
             row.Cells.get_Item(e.get_ColumnIndex()).set_Value(ob);
         }
     }
 }
Exemplo n.º 11
0
 private void dgServices_CellEndEdit(object sender, System.Windows.Forms.DataGridViewCellEventArgs e)
 {
     if ((!this.m_dgServices_Cell_Editing && (this.dgServices.Rows.get_Item(e.get_RowIndex()).Cells.get_Item(e.get_ColumnIndex()).get_Value() != null)) && (this.dgServices.Columns.get_Item(e.get_ColumnIndex()).get_Name() == "SumPay"))
     {
         this.Payments_Fill();
     }
 }
 private void dgvApartmentCounterIndicationsView_CellEndEdit(object sender, System.Windows.Forms.DataGridViewCellEventArgs e)
 {
     if ((e.get_RowIndex() >= 0) && (e.get_ColumnIndex() >= 0))
     {
         if (e.get_ColumnIndex() == this.dgcNewVal.get_Index())
         {
             decimal num;
             string str = (this.dgvApartmentCounterIndicationsView.CurrentCell.get_Value() ?? "").ToString().Replace(',', '.');
             if ((str != "") && decimal.TryParse(str, ref num))
             {
                 ApartmentCounterIndicationInputView view = this.dgvApartmentCounterIndicationsView.Rows.get_Item(e.get_RowIndex()).get_DataBoundItem() as ApartmentCounterIndicationInputView;
                 view.IsValueChanged = true;
                 if (((decimal) this.dgvApartmentCounterIndicationsView.get_Item(this.newValueTemp.get_Index(), this.dgvApartmentCounterIndicationsView.CurrentCell.get_RowIndex()).get_Value()) != num)
                 {
                     this.dgvApartmentCounterIndicationsView.CurrentCell.set_Value(num.ToString());
                     this.dgvApartmentCounterIndicationsView.get_Item(this.newValueTemp.get_Index(), this.dgvApartmentCounterIndicationsView.CurrentCell.get_RowIndex()).set_Value(num);
                 }
             }
             else
             {
                 this.dgvApartmentCounterIndicationsView.CurrentCell.set_Value("");
                 ApartmentCounterIndicationInputView view2 = this.dgvApartmentCounterIndicationsView.Rows.get_Item(e.get_RowIndex()).get_DataBoundItem() as ApartmentCounterIndicationInputView;
                 view2.IsValueChanged = false;
                 view2.NewVal = view2.Val;
             }
         }
         try
         {
             ApartmentCounterIndicationInputView currentIndication = this.GetCurrentIndication();
             if (currentIndication != ApartmentCounterIndicationInputView.Null)
             {
                 System.Windows.Forms.DataGridViewRow row = this.dgvApartmentCounterIndicationsView.Rows.get_Item(e.get_RowIndex());
                 row.Cells.get_Item("counterConsumption").set_Value(0);
                 if ((currentIndication.Val == currentIndication.NewVal) && !currentIndication.IsValueChanged)
                 {
                     this.dgvApartmentCounterIndicationsView.Rows.get_Item(e.get_RowIndex()).DefaultCellStyle.set_BackColor(System.Drawing.Color.White);
                 }
                 else if (!currentIndication.Validate())
                 {
                     this.dgvApartmentCounterIndicationsView.Rows.get_Item(e.get_RowIndex()).DefaultCellStyle.set_BackColor(System.Drawing.Color.LightPink);
                 }
                 else
                 {
                     this.dgvApartmentCounterIndicationsView.Rows.get_Item(e.get_RowIndex()).DefaultCellStyle.set_BackColor(System.Drawing.Color.PaleGreen);
                     row.Cells.get_Item("counterConsumption").set_Value(currentIndication.NewVal - currentIndication.Val);
                 }
             }
         }
         catch (System.Exception exception)
         {
             Messages.ShowException(this, exception);
         }
         if ((e.get_ColumnIndex() == this.NewValDate.get_Index()) && (e.get_RowIndex() == 0))
         {
             System.DateTime date = (System.DateTime) this.dgvApartmentCounterIndicationsView.Rows.get_Item(e.get_RowIndex()).Cells.get_Item(e.get_ColumnIndex()).get_Value();
             this.SetGlobalIndicationDate(date);
         }
         else if ((e.get_ColumnIndex() == this.dgcNewVal.get_Index()) && (e.get_RowIndex() == (this.dgvApartmentCounterIndicationsView.Rows.get_Count() - 1)))
         {
             this.SaveIndications();
         }
         if (e.get_RowIndex() != (this.dgvApartmentCounterIndicationsView.Rows.get_Count() - 1))
         {
             this.m_CancelRowValidation = true;
         }
         if ((e.get_ColumnIndex() == this.NewValDate.get_Index()) && (e.get_RowIndex() < (this.dgvApartmentCounterIndicationsView.Rows.get_Count() - 1)))
         {
             this.dgvApartmentCounterIndicationsView.Refresh();
             this.dgvApartmentCounterIndicationsView.EndEdit();
             if (this.dgvApartmentCounterIndicationsView.CurrentCell.get_Selected())
             {
                 this.dgvApartmentCounterIndicationsView.set_CurrentCell(this.dgvApartmentCounterIndicationsView.get_Item(this.dgcNewVal.get_Index(), e.get_RowIndex()));
             }
             this.m_CancelRowValidation = false;
         }
         else
         {
             this.m_CancelRowValidation = false;
             if ((this.dgvApartmentCounterIndicationsView.get_RowCount() > 0) && this.m_IsFirstUpdate)
             {
                 if (this.dgvApartmentCounterIndicationsView.CurrentCell.get_Selected())
                 {
                     this.dgvApartmentCounterIndicationsView.set_CurrentCell(this.dgvApartmentCounterIndicationsView.get_Item(this.NewValDate.get_Index(), e.get_RowIndex()));
                 }
                 this.m_CancelRowValidation = true;
             }
         }
     }
 }
Exemplo n.º 13
0
        private void m_PaymentsGrid_CellFormatting(object sender, System.Windows.Forms.DataGridViewCellFormattingEventArgs e)
        {
            if (this.m_PaymentsGrid.Columns.get_Item(e.get_ColumnIndex()) == this.externalTransactionIdDataGridViewTextBoxColumn)
            {
                System.Windows.Forms.DataGridViewRow row = this.m_PaymentsGrid.Rows.get_Item(e.get_RowIndex());
                PayRequest request = (PayRequest) row.get_DataBoundItem();
                if (request.IsConfirmed)
                {
                    if (request.IsProcessed)
                    {
                        switch (request.ReverseStatus)
                        {
                            case 0:
                                row.DefaultCellStyle.set_ForeColor(System.Drawing.Color.Black);
                                return;

                            case 1:
                                row.DefaultCellStyle.set_ForeColor(System.Drawing.Color.Blue);
                                return;

                            case 2:
                                row.DefaultCellStyle.set_ForeColor(System.Drawing.Color.Red);
                                return;
                        }
                        throw new System.ApplicationException("Неизвестный статус запроса " + ((long) request.Id));
                    }
                    row.DefaultCellStyle.set_ForeColor(System.Drawing.Color.Green);
                }
            }
        }
Exemplo n.º 14
0
 private void m_Grid_CellPainting(object sender, System.Windows.Forms.DataGridViewCellPaintingEventArgs e)
 {
     if ((e.get_RowIndex() >= 0) && (e.get_ColumnIndex() >= 0))
     {
         System.Windows.Forms.DataGridView view = (System.Windows.Forms.DataGridView) sender;
         FixedSummServiceView view2 = view.Rows.get_Item(e.get_RowIndex()).get_DataBoundItem() as FixedSummServiceView;
         if ((view2 != null) && !view2.CanBeIncluded)
         {
             e.CellStyle.set_BackColor(System.Drawing.Color.LightGray);
         }
     }
 }
Exemplo n.º 15
0
 private void dgvTargetAccountServices_CellValidated(object sender, System.Windows.Forms.DataGridViewCellEventArgs e)
 {
     if (e.get_ColumnIndex() == this.dgvTargetAccountServices.Columns.get_Item("Summ").get_Index())
     {
         string str = this.dgvTargetAccountServices.Rows.get_Item(e.get_RowIndex()).Cells.get_Item(e.get_ColumnIndex()).get_Value().ToString();
         string str2 = System.Globalization.CultureInfo.CurrentCulture.NumberFormat.get_NumberDecimalSeparator();
         this.dgvTargetAccountServices.Rows.get_Item(e.get_RowIndex()).Cells.get_Item(e.get_ColumnIndex()).set_Value(str.Replace(".", str2).Replace(",", str2));
     }
 }
Exemplo n.º 16
0
 private void dgvServiceTariffTypes_CellBeginEdit(object sender, System.Windows.Forms.DataGridViewCellCancelEventArgs e)
 {
     if ((e.get_ColumnIndex() == 1) && (e.get_RowIndex() >= 0))
     {
         this.dgvServiceTariffTypes.Rows.get_Item(e.get_RowIndex()).Cells.get_Item(e.get_ColumnIndex()).Style.set_BackColor(System.Drawing.Color.White);
     }
 }
Exemplo n.º 17
0
 private void dgvServiceTariffTypes_CellEndEdit(object sender, System.Windows.Forms.DataGridViewCellEventArgs e)
 {
     if ((e.get_ColumnIndex() == 1) && (e.get_RowIndex() >= 0))
     {
         ServiceTariffType type = this.dgvServiceTariffTypes.Rows.get_Item(e.get_RowIndex()).get_DataBoundItem() as ServiceTariffType;
         if (type != null)
         {
             decimal num;
             if (type.IsNew && (!decimal.TryParse(this.dgvServiceTariffTypes.Rows.get_Item(e.get_RowIndex()).Cells.get_Item(e.get_ColumnIndex()).get_Value().ToString(), ref num) || (num == 0M)))
             {
                 this.dgvServiceTariffTypes.Rows.get_Item(e.get_RowIndex()).Cells.get_Item(e.get_ColumnIndex()).Style.set_BackColor(System.Drawing.Color.LightGray);
             }
             else
             {
                 this.dgvServiceTariffTypes.Rows.get_Item(e.get_RowIndex()).Cells.get_Item(e.get_ColumnIndex()).Style.set_BackColor(System.Drawing.Color.White);
             }
         }
     }
 }
 private void dgvApartmentCounterIndicationsView_RowValidated(object sender, System.Windows.Forms.DataGridViewCellEventArgs e)
 {
     try
     {
         ApartmentCounterIndicationInputView currentApartmentCounterIndicationInputView = this.GetCurrentApartmentCounterIndicationInputView();
         if (currentApartmentCounterIndicationInputView != ApartmentCounterIndicationInputView.Null)
         {
             if (currentApartmentCounterIndicationInputView.Val == currentApartmentCounterIndicationInputView.NewVal)
             {
                 this.dgvApartmentCounterIndicationsView.Rows.get_Item(e.get_RowIndex()).DefaultCellStyle.set_BackColor(System.Drawing.Color.White);
             }
             else if (!currentApartmentCounterIndicationInputView.ValidationMultiChangeIndication())
             {
                 this.dgvApartmentCounterIndicationsView.Rows.get_Item(e.get_RowIndex()).DefaultCellStyle.set_BackColor(System.Drawing.Color.IndianRed);
             }
             else
             {
                 this.dgvApartmentCounterIndicationsView.Rows.get_Item(e.get_RowIndex()).DefaultCellStyle.set_BackColor(System.Drawing.Color.LawnGreen);
             }
         }
     }
     catch (System.Exception exception)
     {
         Messages.ShowException(this, exception);
     }
 }
Exemplo n.º 19
0
 private void dgvAccounts_RowsAdded(object sender, System.Windows.Forms.DataGridViewRowsAddedEventArgs e)
 {
     for (int i = e.get_RowIndex(); i < (e.get_RowIndex() + e.get_RowCount()); i = (int) (i + 1))
     {
         (sender as System.Windows.Forms.DataGridView).Rows.get_Item(i).Cells.get_Item(0).set_Value(i + 1);
     }
     if ((sender as System.Windows.Forms.DataGridView).get_Name() == "dgvAccounts")
     {
         this.RefreshShares();
     }
 }
Exemplo n.º 20
0
 private void m_ServicesGrid_CellBeginEdit(object sender, System.Windows.Forms.DataGridViewCellCancelEventArgs e)
 {
     if ((this.m_ServicesGrid.Columns.get_Item(e.get_ColumnIndex()) == this.newCounterIndicationDataGridViewTextBoxColumn) && (this.m_OrderDate != Constants.NullDate))
     {
         bool flag = ((PayRequestService) this.m_ServicesGrid.Rows.get_Item(e.get_RowIndex()).get_DataBoundItem()).ValidatedApartmentCounterIndicationDate(this.m_OrderDate);
         this.m_ServicesGrid.Rows.get_Item(e.get_RowIndex()).Cells.get_Item(e.get_ColumnIndex()).set_ReadOnly(flag);
         e.set_Cancel(flag);
         if (flag)
         {
             Messages.ShowMessage("Редактирование показаний невозможно,т.к. на данном счетчике есть показания с датой больше или равной " + this.m_OrderDate.ToShortDateString());
         }
     }
 }
Exemplo n.º 21
0
 private void dgvApartmentResidents_RowsAdded(object sender, System.Windows.Forms.DataGridViewRowsAddedEventArgs e)
 {
     for (int i = e.get_RowIndex(); i < (e.get_RowIndex() + e.get_RowCount()); i = (int) (i + 1))
     {
         this.dgvNewApartmentResidents.Rows.get_Item(i).Cells.get_Item("clmnNumberAprtment").set_Value((this.dgvNewApartmentResidents.Columns.get_Item("clmnNumberAprtment") as System.Windows.Forms.DataGridViewComboBoxColumn).Items.get_Item(1));
     }
 }
Exemplo n.º 22
0
 private void m_ServicesGrid_CellEndEdit(object sender, System.Windows.Forms.DataGridViewCellEventArgs e)
 {
     if (this.m_ServicesGrid.Columns.get_Item(e.get_ColumnIndex()) == this.newCounterIndicationDataGridViewTextBoxColumn)
     {
         PayRequestService service = (PayRequestService) this.m_ServicesGrid.Rows.get_Item(e.get_RowIndex()).get_DataBoundItem();
         ObjectList<PayRequestService> list = (ObjectList<PayRequestService>) this.m_ServicesSource.get_DataSource();
         foreach (PayRequestService service2 in list)
         {
             if (((service2.CounterId == service.CounterId) && (service2.NewCounterIndication != service.NewCounterIndication)) && (service2.CounterId != 0L))
             {
                 service2.NewCounterIndication = service.NewCounterIndication;
             }
         }
     }
     if (this.m_ServicesGrid.Columns.get_Item(e.get_ColumnIndex()) == this.paidDataGridViewTextBoxColumn)
     {
         decimal num = (decimal) this.m_ServicesGrid.Rows.get_Item(e.get_RowIndex()).Cells.get_Item(e.get_ColumnIndex()).get_Value();
         if (num < 0M)
         {
             this.m_ServicesGrid.Rows.get_Item(e.get_RowIndex()).Cells.get_Item(e.get_ColumnIndex()).set_Value(null);
             Messages.ShowWarning("Сумма должна быть положительной!");
         }
         this.m_OneSummPaymentCheckBox.set_Checked(false);
         this.RefreshTotalPaidBox();
         this.m_PaySummBox.set_Text(this.m_TotalPaid.ToString("F2"));
     }
 }
 private void dgvApartmentCounterIndicationsView_RowEnter(object sender, System.Windows.Forms.DataGridViewCellEventArgs e)
 {
     try
     {
         ApartmentCounterIndicationInputView currentApartmentCounterIndicationInputView = this.GetCurrentApartmentCounterIndicationInputView();
         if (currentApartmentCounterIndicationInputView != ApartmentCounterIndicationInputView.Null)
         {
             if (currentApartmentCounterIndicationInputView.Val == currentApartmentCounterIndicationInputView.NewVal)
             {
                 this.dgvApartmentCounterIndicationsView.Rows.get_Item(e.get_RowIndex()).DefaultCellStyle.set_BackColor(System.Drawing.Color.White);
             }
             else
             {
                 if (!currentApartmentCounterIndicationInputView.ValidationMultiChangeIndication())
                 {
                     this.dgvApartmentCounterIndicationsView.Rows.get_Item(e.get_RowIndex()).DefaultCellStyle.set_BackColor(System.Drawing.Color.IndianRed);
                 }
                 else
                 {
                     this.dgvApartmentCounterIndicationsView.Rows.get_Item(e.get_RowIndex()).DefaultCellStyle.set_BackColor(System.Drawing.Color.LawnGreen);
                 }
                 if (currentApartmentCounterIndicationInputView.NewVal > currentApartmentCounterIndicationInputView.Val)
                 {
                     currentApartmentCounterIndicationInputView.Consumption = currentApartmentCounterIndicationInputView.NewVal - currentApartmentCounterIndicationInputView.Val;
                 }
                 else
                 {
                     currentApartmentCounterIndicationInputView.Consumption = System.Convert.ToDecimal(System.Math.Pow(10.0, (currentApartmentCounterIndicationInputView.CounterSize != 0) ? ((double) currentApartmentCounterIndicationInputView.CounterSize) : ((double) 9)));
                 }
             }
         }
     }
     catch (System.Exception exception)
     {
         Messages.ShowException(this, exception);
     }
 }
Exemplo n.º 24
0
 private void m_ServicesGrid_CellFormatting(object sender, System.Windows.Forms.DataGridViewCellFormattingEventArgs e)
 {
     PayRequestService service = (PayRequestService) this.m_ServicesGrid.Rows.get_Item(e.get_RowIndex()).get_DataBoundItem();
     if (service.IsClosed == 1)
     {
         e.CellStyle.set_BackColor(this.m_ClosedServiceColor);
     }
     int num = this.newCounterIndicationDataGridViewTextBoxColumn.get_Index();
     this.m_ServicesGrid.Rows.get_Item(e.get_RowIndex()).Cells.get_Item(num).set_ReadOnly((bool) (service.CounterId == 0L));
 }
Exemplo n.º 25
0
 private void dgvInspections_CellMouseDoubleClick(object sender, System.Windows.Forms.DataGridViewCellMouseEventArgs e)
 {
     if ((this.dgvInspections.SelectedRows.get_Count() != 0) && (e.get_RowIndex() != -1))
     {
         UjfApartmentHouseInspection inspection = (UjfApartmentHouseInspection) this.bsHouseInspection.get_Current();
         if (inspection != null)
         {
             new UjfApartmentHousePartElementForm(inspection).ShowDialog(this);
         }
     }
 }
 private void dgvAccountService_CellEndEdit(object sender, System.Windows.Forms.DataGridViewCellEventArgs e)
 {
     if (this.dgvAccountService.Rows.get_Item(e.get_RowIndex()).Cells.get_Item(e.get_ColumnIndex()).get_Value() != null)
     {
         try
         {
             decimal.Parse((string) ((string) this.dgvAccountService.Rows.get_Item(e.get_RowIndex()).Cells.get_Item(e.get_ColumnIndex()).get_Value()));
         }
         catch (System.Exception)
         {
             Messages.ShowWarning("Введите число");
             this.dgvAccountService.Rows.get_Item(e.get_RowIndex()).Cells.get_Item(e.get_ColumnIndex()).set_Value(null);
         }
     }
 }
 private void dgvServiceNormTypes_CellEndEdit(object sender, System.Windows.Forms.DataGridViewCellEventArgs e)
 {
     System.Windows.Forms.DataGridViewRow row = this.dgvServiceNormTypes.Rows.get_Item(e.get_RowIndex());
     if (row != null)
     {
         object ob = row.Cells.get_Item(e.get_ColumnIndex()).get_Value();
         this.ObjectParseDecimal(ref ob);
         row.Cells.get_Item(e.get_ColumnIndex()).set_Value(ob);
         bool flag = false;
         if (ob != null)
         {
             try
             {
                 if (!((bool) ob) && this.Selected.get_Visible())
                 {
                     ServiceNormType type2 = row.get_DataBoundItem() as ServiceNormType;
                     foreach (System.Data.DataRow row3 in this.dtServiceNormTypes.Rows)
                     {
                         if (((((long) row3.get_Item("serviceNormTypeId")) == type2.Id) && (((long) row3.get_Item("serviceNormId")) == type2.ServiceNormId)) && (((int) row3.get_Item("apartmentPropertyId")) == type2.ApartmentPropertyId))
                         {
                             row3.Delete();
                             flag = true;
                             break;
                         }
                     }
                     return;
                 }
             }
             catch
             {
             }
             ServiceNormType type3 = row.get_DataBoundItem() as ServiceNormType;
             if (!flag)
             {
                 this.dtServiceNormTypes.Rows.Add((object[]) new object[] { ((long) type3.Id), ((long) type3.ServiceNormId), this.dgvServiceNormTypes.CurrentRow.Cells.get_Item("NewValueNorm").get_Value(), ((short) type3.FasetId), ((int) type3.ApartmentPropertyId) });
             }
         }
         else if (!this.Selected.get_Visible())
         {
             ServiceNormType type = (ServiceNormType) this.bsServiceNormTypes.get_Current();
             foreach (System.Data.DataRow row2 in this.dtServiceNormTypes.Rows)
             {
                 if (((((long) row2.get_Item("serviceNormTypeId")) == type.Id) && (((long) row2.get_Item("serviceNormId")) == type.ServiceNormId)) && (((int) row2.get_Item("apartmentPropertyId")) == type.ApartmentPropertyId))
                 {
                     flag = true;
                     if ((this.dgvServiceNormTypes.CurrentRow.Cells.get_Item("NewValueNorm").get_Value() == null) || (this.dgvServiceNormTypes.CurrentRow.Cells.get_Item("NewValueNorm").get_Value().ToString() == ""))
                     {
                         row2.Delete();
                     }
                     else
                     {
                         row2.set_Item("rate", this.dgvServiceNormTypes.CurrentRow.Cells.get_Item("NewValueNorm").get_Value());
                     }
                     break;
                 }
             }
         }
     }
 }
Exemplo n.º 28
0
 private void dgvSubqualities_RowsAdded(object sender, System.Windows.Forms.DataGridViewRowsAddedEventArgs e)
 {
     this.dgvSubqualities.Rows.get_Item(e.get_RowIndex()).Cells.get_Item("Number").set_Value(e.get_RowIndex() + 1);
     ((DataGridViewSmartComboCell) this.dgvSubqualities.Rows.get_Item(e.get_RowIndex()).Cells.get_Item("City")).set_DataSource(LocalAddress.GetByLevel(AddressLevel.MinAddress));
     ((System.Windows.Forms.DataGridViewComboBoxCell) this.dgvSubqualities.Rows.get_Item(e.get_RowIndex()).Cells.get_Item("City")).set_ValueMember("Id");
     ((System.Windows.Forms.DataGridViewComboBoxCell) this.dgvSubqualities.Rows.get_Item(e.get_RowIndex()).Cells.get_Item("City")).set_DisplayMember("Name");
     ((System.Windows.Forms.DataGridViewComboBoxCell) this.dgvSubqualities.Rows.get_Item(e.get_RowIndex()).Cells.get_Item("Street")).set_ValueMember("Id");
     ((System.Windows.Forms.DataGridViewComboBoxCell) this.dgvSubqualities.Rows.get_Item(e.get_RowIndex()).Cells.get_Item("Street")).set_DisplayMember("Name");
     ((System.Windows.Forms.DataGridViewComboBoxCell) this.dgvSubqualities.Rows.get_Item(e.get_RowIndex()).Cells.get_Item("House")).set_ValueMember("Id");
     ((System.Windows.Forms.DataGridViewComboBoxCell) this.dgvSubqualities.Rows.get_Item(e.get_RowIndex()).Cells.get_Item("House")).set_DisplayMember("Name");
     ((System.Windows.Forms.DataGridViewComboBoxCell) this.dgvSubqualities.Rows.get_Item(e.get_RowIndex()).Cells.get_Item("Flat")).set_ValueMember("Id");
     ((System.Windows.Forms.DataGridViewComboBoxCell) this.dgvSubqualities.Rows.get_Item(e.get_RowIndex()).Cells.get_Item("Flat")).set_DisplayMember("Name");
 }
Exemplo n.º 29
0
 private void dgvIncludedReesters_CellContentClick(object sender, System.Windows.Forms.DataGridViewCellEventArgs e)
 {
     if ((e.get_ColumnIndex() == 0) && (e.get_RowIndex() >= 0))
     {
         PayPaymentOrder paymentOrder = this.bsPaymentOrders.get_Current() as PayPaymentOrder;
         if (paymentOrder != null)
         {
             this.dgvIncludedReesters.EndEdit();
             System.Windows.Forms.DataGridViewCheckBoxCell cell = this.dgvIncludedReesters.Rows.get_Item(e.get_RowIndex()).Cells.get_Item(e.get_ColumnIndex()) as System.Windows.Forms.DataGridViewCheckBoxCell;
             if (cell != null)
             {
                 bool flag = ((cell == null) || (cell.get_Value() == null)) ? ((bool) false) : ((bool) ((bool) cell.get_Value()));
                 PayReester reester = cell.OwningRow.get_DataBoundItem() as PayReester;
                 if (flag)
                 {
                     if (reester.PaymentOrderId != paymentOrder.Id)
                     {
                         if (this.reestersPaymentOrderDict.Contains(reester))
                         {
                             this.reestersPaymentOrderDict.set_Item(reester, (long) paymentOrder.Id);
                         }
                         else
                         {
                             this.reestersPaymentOrderDict.Add(reester, (long) paymentOrder.Id);
                         }
                     }
                     else if (this.reestersPaymentOrderDict.Contains(reester))
                     {
                         this.reestersPaymentOrderDict.Remove(reester);
                     }
                 }
                 else if (reester.PaymentOrderId == paymentOrder.Id)
                 {
                     if (this.reestersPaymentOrderDict.Contains(reester))
                     {
                         this.reestersPaymentOrderDict.set_Item(reester, null);
                     }
                     else
                     {
                         this.reestersPaymentOrderDict.Add(reester, null);
                     }
                 }
                 else if (this.reestersPaymentOrderDict.Contains(reester))
                 {
                     this.reestersPaymentOrderDict.Remove(reester);
                 }
                 this.UpdateReesterDeltaSum(paymentOrder);
             }
         }
     }
 }
Exemplo n.º 30
0
 private void dgvDebtors_RowEnter(object sender, System.Windows.Forms.DataGridViewCellEventArgs e)
 {
     if (!this.IsBusy())
     {
         Account @null = Account.Null;
         try
         {
             @null = Account.FindById((long) ((long) this.dgvDebtors.Rows.get_Item(e.get_RowIndex()).Cells.get_Item("accountId").get_Value()));
         }
         catch (System.Exception exception)
         {
             if (exception.GetType() == typeof(ObjectNotFoundException))
             {
                 this.dgvDebtors.Rows.Clear();
                 @null = Account.Null;
             }
         }
         if (@null != this.m_Account)
         {
             this.m_Account = @null;
             this.tsLabelAccountServices.set_Text("Услуги лицевого счета №" + this.m_Account.Number);
             this.tsLabelAccountServices.set_Image(Resources.LOADING);
             this.dgvAccountServices.set_DataSource(null);
             this.m_WorkerGetAccountServices.RunWorkerAsync();
         }
     }
 }