Example #1
0
 public UjfOrderChangeForm(UjfOrders od)
 {
     this.order = UjfOrders.Null;
     this.InitializeComponent();
     this.set_Font(Manager.WindowFont);
     this.order = od;
     this.tbNumber.set_Text(System.Convert.ToString(od.Number));
     this.dbxDate.Value = System.Convert.ToDateTime(od.Date);
     this.rtbShortName.set_Text(System.Convert.ToString(od.ShortName));
     this.bsDirectors.set_DataSource(Mappers.UjfOrganizationPersonnelMapper.FindByOrganizationId(od.OrgId));
     this.bsChairmans.set_DataSource(Mappers.UjfOrganizationPersonnelMapper.FindByOrganizationId(od.OrgId));
     UjfOrganizationPersonnel personnel = new UjfOrganizationPersonnel {
         EmployeeName = "Не выбрано",
         Id = 0L
     };
     this.bsDirectors.Insert(0, personnel);
     this.bsChairmans.Insert(0, personnel);
     this.cbDirector.set_DataSource(this.bsDirectors);
     this.cbDirector.set_DisplayMember("EmployeeName");
     this.cbDirector.set_ValueMember("Id");
     this.cbDirector.set_SelectedValue((long) this.order.Director);
     this.cbChairman.set_DataSource(this.bsChairmans);
     this.cbChairman.set_DisplayMember("EmployeeName");
     this.cbChairman.set_ValueMember("Id");
     this.cbChairman.set_SelectedValue((long) this.order.Chairman);
     if (this.base_OrderParts == null)
     {
         this.temp_OrderParts = Mappers.UjfOrderPartsMapper.GetByOrderId(this.order.Id);
         this.base_OrderParts = new ObjectList<UjfOrderParts>();
         if (this.temp_OrderParts.get_Count() > 0)
         {
             foreach (UjfOrderParts parts in this.temp_OrderParts)
             {
                 this.base_OrderParts.Add(parts);
             }
         }
     }
     if (this.base_InsectionList == null)
     {
         this.temp_InsectionList = Mappers.UjfApartmentHouseInspectionMapper.FindByOrderId(this.order.Id);
         this.base_InsectionList = new ObjectList<UjfApartmentHouseInspection>();
         if (this.temp_InsectionList.get_Count() > 0)
         {
             foreach (UjfApartmentHouseInspection inspection in this.temp_InsectionList)
             {
                 this.base_InsectionList.Add(inspection);
             }
         }
     }
     this.UpdateBsOrderParts();
     this.UpdateBsInspections();
     this.ujfSelectCommittee.LoadCommittees(this.order.Id);
 }
Example #2
0
 public UjfOrderChangeForm()
 {
     this.order = UjfOrders.Null;
     this.InitializeComponent();
     this.set_Font(Manager.WindowFont);
 }
Example #3
0
 private void tsBtnAdd_Click(object sender, System.EventArgs e)
 {
     UjfOrders od = new UjfOrders {
         OrgId = User.CurrentUser.OrgId
     };
     od.SaveChanges();
     UjfOrderChangeForm form = new UjfOrderChangeForm(od);
     form.ShowDialog();
     if (form.DialogResult != System.Windows.Forms.DialogResult.OK)
     {
         od.Delete();
     }
     else
     {
         this.UpdateBsOrders();
     }
 }