示例#1
0
 public UjfChangePeriodForm(UjfApartmentHouseInspection inspection, System.Windows.Forms.IWin32Window owner)
 {
     this.InitializeComponent();
     this.set_Font(Manager.WindowFont);
     this.mOwner = owner;
     this.mInspection = inspection;
 }
 public UjfApartmentHousePartElementForm(UjfApartmentHouseInspection inspection)
 {
     this.InitializeComponent();
     if (!Manager.DesignMode)
     {
         this.set_Font(Manager.WindowFont);
         this.mInspection = inspection;
         this.m_inspectionId = inspection.Id;
         this.ujfApartmentHouseDefectView.UpdateBindingDefect(this.m_inspectionId);
         this.ujfApartmentHouseDefectView.SetColor(0);
         this.ujfApartmentHouseDefectView.AllowChanges(0);
         this.ujfApartmentHousePartElementView.OnTabExitFromPartElements += new System.EventHandler(this.ujfApartmentHousePartElementView_OnTabExitFromPartElements);
         this.ujfApartmentHouseDefectView.OnTabExitFromDefects += new System.EventHandler(this.ujfApartmentHouseDefectView_OnTabExitFromDefects);
         this.tslAdr.set_Text(inspection.AdrName);
         this.tslData.set_Text(inspection.InspectionDateTime.ToShortDateString());
         this.tslStatus.set_Text(inspection.StatusName);
         this.ujfApartmentHousePartElementView.Inspection = inspection;
     }
 }
 public UjfApartmentHouseAddChangeInspectionsForm(UjfApartmentHouseInspection ahi)
 {
     this.InitializeComponent();
     this.set_Font(Manager.WindowFont);
     this.apartmentHouseInspection = ahi;
     this.inspectionStatusFasetData.Faset = FasetsEnum.UjfApartmentHouseInspectionStatus;
     this.inspectionStatusFasetData.RefreshValuesWithNull();
     this.inspectionStatusFasetData.SelectedFasetItem = FasetItem.Null;
     this.tbInspector.set_Text(ahi.Inspector);
     if (!this.apartmentHouseInspection.IsNew)
     {
         this.dtp_InspectionDate.set_Value(this.apartmentHouseInspection.InspectionDateTime);
         if (this.apartmentHouseInspection.StatusId != 0)
         {
             this.inspectionStatusFasetData.SelectedFasetItem = FasetItem.FindById(this.apartmentHouseInspection.StatusId);
         }
         else
         {
             this.inspectionStatusFasetData.set_SelectedIndex(0);
         }
         this.set_Text("Изменить параметры осмотра");
         this.btnOk.set_Text("Изменить");
     }
 }
示例#4
0
 private void tsBtnDeleteInstepction_Click(object sender, System.EventArgs e)
 {
     UjfApartmentHouseInspection inspection = new UjfApartmentHouseInspection();
     inspection = this.bsHouseInspection.get_Current() as UjfApartmentHouseInspection;
     if (inspection != null)
     {
         if (System.Windows.Forms.MessageBox.Show("Вы действительно хотите удалить этот осмотр? Удаление осмотра также удалит все ссылки на него!", "Внимание", System.Windows.Forms.MessageBoxButtons.YesNo) != System.Windows.Forms.DialogResult.No)
         {
             new UjfApartmentHouseDefectSheduleView().DeleteByCurrentInspection(inspection.Id);
             new UjfApartmentHouseDefectView().DeleteByCurrentInspection(inspection.Id);
             inspection.Delete();
             inspection.SaveChanges();
             this.UpdateBindingSourceHouseInspection();
         }
     }
     else
     {
         System.Windows.Forms.MessageBox.Show("Выберите строку для удаления");
     }
 }
示例#5
0
 private void tsBtnChangeInspection_Click(object sender, System.EventArgs e)
 {
     UjfApartmentHouseInspection ahi = new UjfApartmentHouseInspection();
     ahi = this.bsHouseInspection.get_Current() as UjfApartmentHouseInspection;
     if (ahi != null)
     {
         new UjfApartmentHouseAddChangeInspectionsForm(ahi).ShowDialog();
         this.UpdateBindingSourceHouseInspection();
     }
     else
     {
         System.Windows.Forms.MessageBox.Show("Выберите строку для изменения");
     }
 }
示例#6
0
 private void tsBtnAddInspection_Click(object sender, System.EventArgs e)
 {
     UjfApartmentHouseInspection ahi = new UjfApartmentHouseInspection {
         HouseId = this.house.Id
     };
     new UjfApartmentHouseAddChangeInspectionsForm(ahi).ShowDialog(this);
     this.UpdateBindingSourceHouseInspection();
 }
示例#7
0
 private void dgvInspections_PreviewKeyDown(object sender, System.Windows.Forms.PreviewKeyDownEventArgs e)
 {
     if (this.dgvInspections.SelectedRows.get_Count() != 0)
     {
         if (e.KeyCode == System.Windows.Forms.Keys.Enter)
         {
             UjfApartmentHouseInspection inspection = (UjfApartmentHouseInspection) this.bsHouseInspection.get_Current();
             if (inspection != null)
             {
                 new UjfApartmentHousePartElementForm(inspection).ShowDialog(this);
             }
         }
         if (e.KeyCode == System.Windows.Forms.Keys.Delete)
         {
             UjfApartmentHouseInspection inspection2 = new UjfApartmentHouseInspection();
             inspection2 = this.bsHouseInspection.get_Current() as UjfApartmentHouseInspection;
             if (inspection2 != null)
             {
                 if (System.Windows.Forms.MessageBox.Show("Вы действительно хотите удалить этот осмотр? Удаление осмотра также удалит все ссылки на него!", "Внимание", System.Windows.Forms.MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.No)
                 {
                     return;
                 }
                 new UjfApartmentHouseDefectSheduleView().DeleteByCurrentInspection(inspection2.Id);
                 new UjfApartmentHouseDefectView().DeleteByCurrentInspection(inspection2.Id);
                 inspection2.Delete();
                 inspection2.SaveChanges();
                 this.UpdateBindingSourceHouseInspection();
             }
             else
             {
                 System.Windows.Forms.MessageBox.Show("Выберите строку для удаления");
             }
         }
         if (e.KeyCode == System.Windows.Forms.Keys.Insert)
         {
             UjfApartmentHouseInspection ahi = new UjfApartmentHouseInspection {
                 HouseId = this.house.Id
             };
             new UjfApartmentHouseAddChangeInspectionsForm(ahi).ShowDialog(this);
             this.UpdateBindingSourceHouseInspection();
         }
         if (e.KeyCode == System.Windows.Forms.Keys.F2)
         {
             UjfApartmentHouseInspection inspection4 = new UjfApartmentHouseInspection();
             inspection4 = this.bsHouseInspection.get_Current() as UjfApartmentHouseInspection;
             if (inspection4 != null)
             {
                 new UjfApartmentHouseAddChangeInspectionsForm(inspection4).ShowDialog();
                 this.UpdateBindingSourceHouseInspection();
             }
             else
             {
                 System.Windows.Forms.MessageBox.Show("Выберите строку для изменения");
             }
         }
     }
 }
 private void btnOk_Click(object sender, System.EventArgs e)
 {
     ObjectList<LocalAddress> addresses = (ObjectList<LocalAddress>) this.bsAddress.get_DataSource();
     ObjectList<House> list2 = House.FindByAddresses(addresses);
     if (this.HouseInspList != null)
     {
         if (this.btnOk.get_Text() == "Изменить")
         {
             this.HouseInspList.Clear();
         }
         foreach (House house in list2)
         {
             UjfApartmentHouseInspection inspection = new UjfApartmentHouseInspection {
                 InspectionDateTime = this.dtpInspectionDate.Value
             };
             if (this.inspectionStatusFasetData.get_SelectedIndex() != 0)
             {
                 inspection.StatusId = this.inspectionStatusFasetData.SelectedFasetItem.Id;
             }
             inspection.Inspector = this.tbInspector.get_Text();
             inspection.UserName = User.CurrentUser.Name;
             inspection.OrderId = this.orderId;
             inspection.HouseId = house.Id;
             inspection.AdrName = house.AdrName;
             inspection.StatusName = this.inspectionStatusFasetData.SelectedFasetItem.Name;
             this.HouseInspList.Add(inspection);
         }
     }
 }