本文整理汇总了C#中System.get_ColumnIndex方法的典型用法代码示例。如果您正苦于以下问题:C# System.get_ColumnIndex方法的具体用法?C# System.get_ColumnIndex怎么用?C# System.get_ColumnIndex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System
的用法示例。
在下文中一共展示了System.get_ColumnIndex方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: dg_spun_fl_CellContentClick
private void dg_spun_fl_CellContentClick(object sender, System.Windows.Forms.DataGridViewCellEventArgs e)
{
if ((e.get_RowIndex() != -1) && (this.dg_spun_fl.Columns.get_Item(e.get_ColumnIndex()) == this.spun_move_to_sn_Column))
{
this.NewEqualityPersonFromSpun((SidPerson) this.bsSidPerson.get_Current());
this.bsEqualityPerson.set_DataSource(null);
this.bsEqualityPerson.set_DataSource(EqualityPerson.GetOriginalPersons(this.equalityPersons));
this.bsSnPerson.set_DataSource(null);
this.bsSnPerson.set_DataSource(this.residents);
if (this.bsEqualityPerson.get_Count() > 0)
{
this.bsEqualityPerson.set_Position(0);
}
}
}
示例2: dgvRecalcPeriod_CellFormatting
private void dgvRecalcPeriod_CellFormatting(object sender, System.Windows.Forms.DataGridViewCellFormattingEventArgs e)
{
if ((this.dgvRecalcPeriod.Columns.get_Item(e.get_ColumnIndex()) == this.DiffChargeSummPeriod) || (this.dgvRecalcPeriod.Columns.get_Item(e.get_ColumnIndex()) == this.DiffBenefitSummPeriod))
{
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);
}
}
}
示例3: dgvServiceNormTypes_CellEndEdit
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;
}
}
}
}
}
示例4: dgvServiceTariffTypes_CellBeginEdit
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);
}
}
示例5: dgvHouses_CellEndEdit
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());
}
}
示例6: m_ServicesGrid_CellEndEdit
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"));
}
}
示例7: dgvAccountService_CellEndEdit
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);
}
}
}
示例8: dgvTargetAccountServices_CellValidated
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));
}
}
示例9: dgvTargetAccountServices_CellValidating
private void dgvTargetAccountServices_CellValidating(object sender, System.Windows.Forms.DataGridViewCellValidatingEventArgs e)
{
if (e.get_ColumnIndex() == this.dgvTargetAccountServices.Columns.get_Item("Summ").get_Index())
{
decimal num;
string str = System.Globalization.CultureInfo.CurrentCulture.NumberFormat.get_NumberDecimalSeparator();
if (!decimal.TryParse(((string) e.get_FormattedValue()).Replace(".", str).Replace(",", str), ref num))
{
e.set_Cancel(true);
Messages.ShowWarning("Введенная сумма не является числом! Для отмены ввода нажмите ESCAPE.");
}
if (num < 0M)
{
e.set_Cancel(true);
Messages.ShowWarning("Введенная сумма должна быть положительной! Для отмены ввода нажмите ESCAPE.");
}
}
}
示例10: dgvServices_CellBeginEdit
private void dgvServices_CellBeginEdit(object sender, System.Windows.Forms.DataGridViewCellCancelEventArgs e)
{
if (((this.dgvServices.Columns.get_Item(e.get_ColumnIndex()) == this.ServiceNormRate) || (this.dgvServices.Columns.get_Item(e.get_ColumnIndex()) == this.ServiceNormFromDate)) && (this._mServiceOld.ServiceNormId == ServiceNorm.Null.Id))
{
Messages.ShowMessage("Необходимо сначала задать норматив на исходной услуге");
e.set_Cancel(true);
}
}
示例11: dgvServices_CellValidating
private void dgvServices_CellValidating(object sender, System.Windows.Forms.DataGridViewCellValidatingEventArgs e)
{
try
{
if ((this.dgvServices.Columns.get_Item(e.get_ColumnIndex()) == this.CurrentRateFromDate) || (this.dgvServices.Columns.get_Item(e.get_ColumnIndex()) == this.ServiceNormFromDate))
{
if (((string) e.get_FormattedValue()) != string.Empty)
{
System.DateTime.Parse((string) ((string) e.get_FormattedValue()));
}
else
{
this.dgvServices.Rows.get_Item(e.get_RowIndex()).Cells.get_Item(e.get_ColumnIndex()).set_Value(Constants.NullDate);
ServiceOld old = (ServiceOld) this.dgvServices.Rows.get_Item(e.get_RowIndex()).get_DataBoundItem();
if (this.dgvServices.Columns.get_Item(e.get_ColumnIndex()) == this.CurrentRateFromDate)
{
old.CurrentRateFromDate = Constants.NullDate;
old.CurrentRate = 0M;
}
if (this.dgvServices.Columns.get_Item(e.get_ColumnIndex()) == this.ServiceNormFromDate)
{
old.ServiceNormFromDate = Constants.NullDate;
old.ServiceNormRate = 0M;
}
this.bsServices.ResumeBinding();
}
}
else if (((this.dgvServices.Columns.get_Item(e.get_ColumnIndex()) == this.CurrentRate) || (this.dgvServices.Columns.get_Item(e.get_ColumnIndex()) == this.ServiceNormRate)) && (((string) e.get_FormattedValue()) != string.Empty))
{
decimal.Parse((string) ((string) e.get_FormattedValue()));
}
}
catch (System.Exception exception)
{
Messages.ShowException(this, exception);
e.set_Cancel(true);
}
}
示例12: dgvAccountServiceTariffs_CellEndEdit
private void dgvAccountServiceTariffs_CellEndEdit(object sender, System.Windows.Forms.DataGridViewCellEventArgs e)
{
if ((e.get_RowIndex() >= 0) && (e.get_ColumnIndex() >= 0))
{
if (e.get_ColumnIndex() == this.NewRate.get_Index())
{
decimal num;
System.Windows.Forms.DataGridViewCell cell = this.dgvAccountServiceTariffs.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);
}
}
else if (e.get_ColumnIndex() == this.NewNormRate.get_Index())
{
decimal num2;
System.Windows.Forms.DataGridViewCell cell2 = this.dgvAccountServiceTariffs.Rows.get_Item(e.get_RowIndex()).Cells.get_Item(e.get_ColumnIndex());
if (!decimal.TryParse((string) (cell2.get_Value() as string), ref num2))
{
Messages.ShowWarning("Введите корректное значение норматива");
cell2.set_Value(null);
}
if (this.EditPerformed != null)
{
this.EditPerformed(this, e);
}
}
}
}
示例13: dg_spun_reg_CellContentClick
private void dg_spun_reg_CellContentClick(object sender, System.Windows.Forms.DataGridViewCellEventArgs e)
{
if ((e.get_RowIndex() != -1) && (this.dg_spun_reg.Columns.get_Item(e.get_ColumnIndex()) == this.spun_fl_reg_copy_Column))
{
SidPerson sidPerson = (SidPerson) this.bsSidPerson.get_Current();
ResidentPack residentPack = (ResidentPack) this.bsSnPerson.get_Current();
if ((sidPerson == null) || (residentPack == null))
{
AIS.SN.UI.Messages.ShowWarning("Необходимо выделить связанного человека, которому копировать регистрацию");
}
else if (((EqualityPerson.FindBySidPersonAndResidentPack(this.equalityPersons, sidPerson, residentPack) == null) && (sidPerson.equalityed > 0)) && (residentPack.equalityed > 0))
{
AIS.SN.UI.Messages.ShowWarning("Регистрацию можно перенести только на сопоставленного человека");
}
else
{
SidPersonRegistration registration = (SidPersonRegistration) this.bsSidRegistration.get_Current();
ApartmentResident resident = new ApartmentResident {
ApartmentId = this.apartment.Id,
FromDate = registration.FromDate,
ToDate = registration.ToDate,
Relative = registration.Relative,
TypeResidents = registration.TypeResidents
};
this.bsSnApartmentResident.set_DataSource(null);
residentPack.apartmentResidents.Add(resident);
this.bsSnApartmentResident.set_DataSource(residentPack.apartmentResidents);
}
}
}
示例14: dg_spun_fl_CellFormatting
private void dg_spun_fl_CellFormatting(object sender, System.Windows.Forms.DataGridViewCellFormattingEventArgs e)
{
if (e.get_ColumnIndex() == this.spun_move_to_sn_Column.get_Index())
{
if (((SidPerson) this.dg_spun_fl.Rows.get_Item(e.get_RowIndex()).get_DataBoundItem()).equalityed > 0)
{
e.CellStyle.set_ForeColor(e.CellStyle.BackColor);
e.CellStyle.set_SelectionForeColor(e.CellStyle.SelectionBackColor);
}
else
{
e.CellStyle.ApplyStyle(this.dg_spun_fl.DefaultCellStyle);
}
}
else
{
e.set_CellStyle(CalculateCellStyle(e.CellStyle, ((SidPerson) this.bsSidPerson.get_Item(e.get_RowIndex())).matchColor));
}
}
示例15: dgvServiceTariffTypes_CellEndEdit
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;
}
}
}
}
}