Exemple #1
0
        private void mtx0_ClickAfter(object sboObject, SBOItemEventArg pVal)
        {
            try {
                if (!SelectRow(mtx0, pVal.Row))
                {
                    return;
                }

                string docNum   = dt0.GetValue("C_Folio", selectedRow - 1).ToString();
                string docEntry = pendingTransfers.Where(t => t.Folio == docNum).FirstOrDefault().DocEntry.ToString();
                transferItems = foodTransferDAO.GetTransferItems(docEntry);

                Task.Factory.StartNew(() => {
                    this.UIAPIRawForm.Freeze(true);
                    SAPMatrix.Fill("DT1", dt1, mtx1, columns1.Keys.ToList(), transferItems);
                    seriesNumbers = foodTransferDAO.GetSeriesNumbers(docEntry);
                    this.UIAPIRawForm.Freeze(false);
                });
            }
            catch (AggregateException ae) {
                ae.Handle(e => {
                    SAPException.Handle(e, "mtx0_ClickAfter(AggregateException)");
                    return(true);
                });
            }
        }
Exemple #2
0
 public void PrepareMatrix()
 {
     columns = new Dictionary <string, BoFieldsType>()
     {
         { "#", BoFieldsType.ft_ShortNumber }, { "Item", BoFieldsType.ft_AlphaNumeric }, { "Desc", BoFieldsType.ft_AlphaNumeric }, { "Quantity", BoFieldsType.ft_Quantity }
     };
     dt0 = SAPMatrix.CreateDataTable("DT0", columns, this);
     SAPMatrix.Fill("DT0", dt0, mtx0, columns.Keys.ToList(), requestTransfers);
 }
Exemple #3
0
 private void mtx0_ClickAfter(object sboObject, SBOItemEventArg pVal)
 {
     SelectRow(mtx0, pVal.Row);
     transferItems = foodPlantDAO.GetTransferItems(dt0.GetValue("C_Folio", selectedRow - 1).ToString());
     Task.Factory.StartNew(() => {
         this.UIAPIRawForm.Freeze(true);
         SAPMatrix.Fill("DT1", dt1, mtx1, columns1.Keys.ToList(), transferItems);
         this.UIAPIRawForm.Freeze(false);
     });
 }
Exemple #4
0
 public void FillMatrix0()
 {
     columns0 = new Dictionary <string, BoFieldsType>()
     {
         { "#", BoFieldsType.ft_ShortNumber }, { "Folio", BoFieldsType.ft_AlphaNumeric }, { "DocDate", BoFieldsType.ft_AlphaNumeric }, { "Comments", BoFieldsType.ft_AlphaNumeric }
     };
     dt0 = SAPMatrix.CreateDataTable("DT0", columns0, this);
     pendingTransfers = foodTransferDAO.GetPendingTransfers();
     this.UIAPIRawForm.Freeze(true);
     SAPMatrix.Fill("DT0", dt0, mtx0, columns0.Keys.ToList(), pendingTransfers);
     this.UIAPIRawForm.Freeze(false);
 }
Exemple #5
0
        private void CreateTransfer(bool isCancellation)
        {
            var transferDocument = new DocumentTransfer();

            try {
                LogService.WriteInfo("Begin Create Transfer");
                transferDocument.Document = pendingTransfers[selectedRow - 1];
                transferDocument.Lines    = transferItems;
                transferDocument.Series   = seriesNumbers;

                if (!String.IsNullOrEmpty(txtComment.Value))
                {
                    transferDocument.Document.Comments = txtComment.Value;
                }

                Task.Factory.StartNew(() => {
                    return(StockTransferDI.CreateTransfer(transferDocument, isCancellation));
                }).ContinueWith(t => {
                    if (t.Result.Success)
                    {
                        pendingTransfers = foodTransferDAO.GetPendingTransfers();
                        this.UIAPIRawForm.Freeze(true);
                        SAPMatrix.Fill("DT0", dt0, mtx0, columns0.Keys.ToList(), pendingTransfers);
                        this.UIAPIRawForm.Freeze(false);

                        if (isCancellation)
                        {
                            AlertMessageDI.Create(new MessageDTO()
                            {
                                UserCode = foodTransferDAO.GetUserCode(transferDocument.Document.UserID.ToString()),
                                Message  = String.Format("Se ha rechazado la transferencia #{0} y se ha solicitado la trasnferencia de devolución #{1}", transferDocument.Document.Folio, t.Result.DocEntry)
                            });
                        }

                        SAPMatrix.ClearMtx(mtx1);
                        transferItems    = null;
                        seriesNumbers    = null;
                        transferDocument = null;
                    }

                    UIApplication.ShowMessageBox(t.Result.Message);
                    LogService.WriteInfo("End Create Transfer");
                });
            }
            catch (AggregateException ae) {
                ae.Handle(e => {
                    SAPException.Handle(e, "CreateTransfer");
                    return(true);
                });
            }
        }
Exemple #6
0
 private void FillMatrix()
 {
     this.UIAPIRawForm.Freeze(true);
     SAPMatrix.Fill("dt0", dt0, mtx0, columns.Keys.ToList(), components);
     this.UIAPIRawForm.Freeze(false);
 }