Esempio n. 1
0
    private void AppendConcept() {
      LRSTransactionAct act = new LRSTransactionAct(this.transaction);

      act.RecordingActType = RecordingActType.Parse(int.Parse(Request.Form[cboRecordingActType.ClientID]));
      act.LawArticle = LRSLawArticle.Parse(int.Parse(Request.Form[cboLawArticle.ClientID]));
      //act.ReceiptNumber = cboReceipts.Value.Length != 0 ? cboReceipts.Value : txtRecordingActReceipt.Value;

      if (txtOperationValue.Value.Length != 0) {
        act.OperationValue = Money.Parse(Currency.Parse(int.Parse(cboOperationValueCurrency.Value)),
                                         decimal.Parse(txtOperationValue.Value));
      }
      if (txtQuantity.Value.Length != 0) {
        act.Quantity = decimal.Parse(txtQuantity.Value);
      }
      act.Unit = Empiria.DataTypes.Unit.Parse(int.Parse(cboUnit.Value));
      act.Notes = EmpiriaString.TrimAll(txtConceptNotes.Value);
      act.Save();

      txtOperationValue.Value = String.Empty;
      txtQuantity.Value = String.Empty;
      cboUnit.Value = "-1";
      txtConceptNotes.Value = String.Empty;

      onloadScript += "alert('El concepto se agregó correctamente.');";
    }
Esempio n. 2
0
    private void CopyTransaction() {
      SaveTransaction();
      LRSTransaction copy = new LRSTransaction(this.transaction.TransactionType);
      copy.RecorderOffice = this.transaction.RecorderOffice;
      copy.DocumentNumber = this.transaction.DocumentNumber;
      copy.DocumentType = this.transaction.DocumentType;
      copy.ManagementAgency = this.transaction.ManagementAgency;
      //copy.RequestedBy = this.transaction.RequestedBy;
      copy.RequestNotes = this.transaction.RequestNotes;

      bool isSpecialCase = (transaction.TransactionType.Id == 704 || (transaction.TransactionType.Id == 700 && transaction.DocumentType.Id == 722));

      if (isSpecialCase) {
        copy.ReceiptTotal = decimal.Zero;
        copy.ReceiptNumber = "No aplica";
      }
      copy.Save();

      foreach (LRSTransactionAct act in transaction.RecordingActs) {
        LRSTransactionAct newAct = new LRSTransactionAct(copy);

        newAct.RecordingActType = act.RecordingActType;
        newAct.LawArticle = act.LawArticle;
        newAct.OperationValue = act.OperationValue;
        newAct.Quantity = act.Quantity;
        newAct.Unit = act.Unit;
        newAct.Notes = act.Notes;
        if (isSpecialCase) {
          newAct.ReceiptNumber = copy.ReceiptNumber;
        }
        newAct.Save();
        //newAct.ReceiptNumber = transaction.ReceiptNumber;
      }
      onloadScript = @"alert('Este trámite fue copiado correctamente.\n\nEl nuevo trámite es el " + copy.Key +
                     @".\n\nAl cerrar esta ventana se mostrará el nuevo trámite.');";
      onloadScript += "doOperation('goToTransaction', " + copy.Id.ToString() + ");";
    }
Esempio n. 3
0
 private void AppendConcept(int conceptTypeId, int lawArticleId) {
   LRSTransactionAct act = new LRSTransactionAct(this.transaction);
   act.RecordingActType = RecordingActType.Parse(conceptTypeId);
   act.LawArticle = LRSLawArticle.Parse(lawArticleId);
   act.Save();
 }