protected override void ClearText(object sender, System.EventArgs e)
 {
     this.SelectedServiceSplitDocument = null;
     if (this.OnServiceSplitDocumentSelected != null)
     {
         this.OnServiceSplitDocumentSelected(null);
     }
 }
 public void Selected(ServiceSplitDocument serviceSplitDocument)
 {
     this.SelectedServiceSplitDocument = serviceSplitDocument;
     if (this.OnServiceSplitDocumentSelected != null)
     {
         this.OnServiceSplitDocumentSelected(serviceSplitDocument);
     }
 }
 public ServiceSplitDocumentsForm(ServiceSplitDocument doc, ServiceSplitDocumentHandler handler)
 {
     this.InitializeComponent();
     this.handler = handler;
     System.Collections.Generic.List<ServiceSplitDocument> list = new System.Collections.Generic.List<ServiceSplitDocument>();
     if (doc != null)
     {
         list.Add(doc);
     }
     for (int i = (int) (Register.ServiceSplitDocumentCache.get_Count() - 1); i >= 0; i = (int) (i - 1))
     {
         if ((doc == null) || (doc.Id != Register.ServiceSplitDocumentCache.get_Item(i).Id))
         {
             list.Add(Register.ServiceSplitDocumentCache.get_Item(i));
         }
     }
     this.bsServiceSplitDocuments.set_DataSource(list);
 }
 public ServiceSplitDocumentAddChangeForm(ServiceSplitDocument splittingCalc, long splittingCalcId)
     : this()
 {
     this._mServiceSplitDocument = splittingCalc;
     this._mServiceSplitDocument.Id = splittingCalcId;
 }
 public ServiceSplitDocumentAddChangeForm()
 {
     this._mServiceSplitDocument = ServiceSplitDocument.Null;
     this.InitializeComponent();
 }
 private void tbsAdd_Click(object sender, System.EventArgs e)
 {
     ServiceSplitDocument splittingCalc = new ServiceSplitDocument();
     ServiceSplitDocumentAddChangeForm form = new ServiceSplitDocumentAddChangeForm(splittingCalc, splittingCalc.Id);
     form.set_Text("Добавление записи");
     if ((form.ShowDialog(this) != System.Windows.Forms.DialogResult.Yes) && !splittingCalc.IsNew)
     {
         this.bsServiceSplitDocuments.Add(splittingCalc);
         this.bsServiceSplitDocuments.set_Sort("FromDate desc");
         this.bsServiceSplitDocuments.set_Position(this.bsServiceSplitDocuments.IndexOf(splittingCalc));
     }
 }