public ApartmentAreaHistoryForm() { this.m_Apartment = Apartment.Null; this.m_ApartmentArea = ApartmentArea.Null; this.InitializeComponent(); this.set_Font(Manager.WindowFont); }
public ApartmentAreaAddChangeForm(Apartment apart, ApartmentArea apartArea) : this() { this.m_Apartment = apart; this.m_ApartmentArea = apartArea; this.dbFromDateArea.Value = this.m_ApartmentArea.FromDate; this.nudTotalArea.set_Value(this.m_ApartmentArea.Total); this.nudLivingArea.set_Value(this.m_ApartmentArea.Living); this.nudHeatingArea.set_Value(this.m_ApartmentArea.Heating); this.nudBalconyArea.set_Value(this.m_ApartmentArea.Balcony); this.selectOrgDocument.SelectedOrgDocument = (this.m_ApartmentArea.DocId != 0L) ? OrgDocument.FindById(this.m_ApartmentArea.DocId) : OrgDocument.Null; this.btnAddChange.set_Text("Изменить"); }
private void ApartmentAreaAdd() { if (this.m_apartmentArea == ApartmentArea.Null) { this.m_apartmentArea = new ApartmentArea(); this.m_apartmentArea.Id = -1L; this.m_apartmentArea.ApartmentId = this.m_Apartment.Id; } this.m_apartmentArea.FromDate = this.tbFromDate.Value; this.m_apartmentArea.Total = System.Convert.ToDecimal(this.nudTotalArea.Value); this.m_apartmentArea.Living = System.Convert.ToDecimal(this.nudLivingArea.Value); this.m_apartmentArea.Heating = System.Convert.ToDecimal(this.nudHeatingArea.Value); this.m_apartmentArea.Balcony = System.Convert.ToDecimal(this.nudBalconyArea.Value); if (this.selectOrgDocument.SelectedOrgDocument != null) { this.m_apartmentArea.DocId = this.selectOrgDocument.SelectedOrgDocument.Id; } this.m_apartmentArea.SaveChanges(); }
private void tsbApartmentAreaDelete_Click(object sender, System.EventArgs e) { if ((this.bsApartmentArea.get_Current() != null) && (Messages.QuestionYesNo(this, "Вы действительно хотите удалить?") != System.Windows.Forms.DialogResult.No)) { this.m_ApartmentArea = this.bsApartmentArea.get_Current() as ApartmentArea; if ((this.m_ApartmentArea != null) && (this.m_ApartmentArea != ApartmentArea.Null)) { this.m_ApartmentArea.Delete(); this.bsApartmentArea.set_DataSource(ApartmentArea.FindAllByApartmentId(this.m_Apartment.Id)); this.update = true; } } }
private void tsbApartmentAreaChange_Click(object sender, System.EventArgs e) { if (this.m_Apartment != Apartment.Null) { this.m_ApartmentArea = this.bsApartmentArea.get_Current() as ApartmentArea; if ((this.m_ApartmentArea != null) && (this.m_ApartmentArea != ApartmentArea.Null)) { ApartmentAreaAddChangeForm form = new ApartmentAreaAddChangeForm(this.m_Apartment, this.m_ApartmentArea); form.set_Text("Изменение площади жилья"); if (form.ShowDialog(this) == System.Windows.Forms.DialogResult.OK) { this.bsApartmentArea.set_DataSource(ApartmentArea.FindAllByApartmentId(this.m_Apartment.Id)); this.bsApartmentArea.set_Sort(this.bsApartmentArea.get_Sort()); this.update = true; } } } }
private void btnAdd_Click(object sender, System.EventArgs e) { if (this.dbFromDateArea.IsNull) { BalloonWindow window = new BalloonWindow("Не введена дата начала действия."); window.Show(this.btnAddChange); } else { if (this.m_ApartmentArea == null) { this.m_ApartmentArea = new ApartmentArea(); this.m_ApartmentArea.Id = -1L; this.m_ApartmentArea.ApartmentId = this.m_Apartment.Id; } if ((this.nudTotalArea.Value < this.nudLivingArea.Value) || (this.nudTotalArea.Value < this.nudHeatingArea.Value)) { new BalloonWindow("Несоответствие. Измените данные.").Show(this.btnAddChange); } else { this.m_ApartmentArea.FromDate = this.dbFromDateArea.Value; this.m_ApartmentArea.Total = System.Convert.ToDecimal(this.nudTotalArea.Value); this.m_ApartmentArea.Living = System.Convert.ToDecimal(this.nudLivingArea.Value); this.m_ApartmentArea.Heating = System.Convert.ToDecimal(this.nudHeatingArea.Value); this.m_ApartmentArea.Balcony = System.Convert.ToDecimal(this.nudBalconyArea.Value); if ((this.selectOrgDocument.SelectedOrgDocument == OrgDocument.Null) || (this.selectOrgDocument.SelectedOrgDocument == null)) { this.selectOrgDocument.SelectedOrgDocument = OrgDocument.Null; } this.m_ApartmentArea.DocId = this.selectOrgDocument.SelectedOrgDocument.Id; this.m_ApartmentArea.SaveChanges(); base.set_DialogResult(System.Windows.Forms.DialogResult.OK); base.Close(); } } }
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); } }