public ServiceTypeSubQualityAddChangeForm()
 {
     this.mServiceTypeSubQuality = ServiceTypeSubQuality.Null;
     this._mServiceTypeSubQualityPercent = ServiceTypeSubQualityPercent.Null;
     this._mServiceType = ServiceTypeOld.Null;
     this.InitializeComponent();
 }
 public ServiceTypeSubQualityPercentsAddChangeForm(ServiceTypeSubQualityPercent subQualityPercent)
     : this()
 {
     this._mServiceTypeSubQualityPercent = subQualityPercent;
 }
 private void tbsAdd_Click(object sender, System.EventArgs e)
 {
     ServiceTypeSubQualityPercent subQualityPercent = new ServiceTypeSubQualityPercent {
         ServiceTypeSubQualityId = this.mServiceTypeSubQuality.Id
     };
     ServiceTypeSubQualityPercentsAddChangeForm form = new ServiceTypeSubQualityPercentsAddChangeForm(subQualityPercent);
     form.set_Text("Добавление записи");
     if (form.ShowDialog(this) == System.Windows.Forms.DialogResult.Yes)
     {
         this.bsServiceTypeSuspensionPercent.Add(subQualityPercent);
         this.bsServiceTypeSuspensionPercent.set_Position(this.bsServiceTypeSuspensionPercent.IndexOf(subQualityPercent));
     }
 }
 private void ServiceTypeSuspensionTypesAddChangeForm_Load(object sender, System.EventArgs e)
 {
     this.set_Font(Manager.WindowFont);
     ServiceTypeSubQualityPercent percent = new ServiceTypeSubQualityPercent();
     this.bsServiceType.SuspendBinding();
     this.bsServiceType.set_DataSource(ServiceTypeOld.FindAll());
     this.bsServiceType.Add(ServiceTypeOld.Null);
     this.bsServiceType.set_Position(this.bsServiceType.IndexOf(ServiceTypeOld.Null));
     this.bsServiceType.ResumeBinding();
     this.selectFasetServiceTypeSuspension.Faset = FasetsEnum.ServiceTypeSubQuality;
     this.selectFasetServiceTypeSuspension.RefreshValuesWithNull();
     this.selectFasetServiceTypeSuspension.SelectedFasetItem = FasetItem.Null;
     this.set_Font(Manager.WindowFont);
     if (this.mServiceTypeSubQuality.IsNew)
     {
         this.tsButtons.set_Enabled(false);
     }
     percent.ServiceTypeSubQualityId = this.mServiceTypeSubQuality.Id;
     this.bsServiceTypeSuspensionPercent.set_DataSource(this.mServiceTypeSubQuality.GetServiceTypeSubQualityPercents());
     if (!this.mServiceTypeSubQuality.IsNew)
     {
         this.btnOk.set_Text("Изменить");
         this._mServiceType.Id = this.mServiceTypeSubQuality.ServiceTypeId;
         this.selectOrgDocument1.SelectedOrgDocument = OrgDocument.FindById(this.mServiceTypeSubQuality.OrgDocId);
         this.cbxServiceType.set_SelectedItem(ServiceTypeOld.FindById(this._mServiceType.Id));
         this.selectFasetServiceTypeSuspension.set_SelectedItem(FasetItem.FindByName(FasetsEnum.ServiceTypeSubQuality, this.mServiceTypeSubQuality.QualityTypeName));
         this.rtServiceTypeSuspension.set_Text(this.mServiceTypeSubQuality.QualityName);
         this.rtNormativ.set_Text(this.mServiceTypeSubQuality.Normativ);
         this.rtRule.set_Text(this.mServiceTypeSubQuality.SuspensionRule);
         this.UpdateBindingServiceTypeSuspensionTypes();
     }
     else
     {
         this.btnOk.set_Text("Добавить");
         this.bsServiceType.set_Position(this.bsServiceType.IndexOf(ServiceTypeOld.Null));
     }
 }