Ejemplo n.º 1
0
        private void UpdateMatrix()
        {
            try
            {
                this.UIAPIRawForm.Freeze(true);
                decimal lDecPaymentPayment = 0;
                for (int i = 0; i < DtMatrixAuctions.Rows.Count; i++)
                {
                    string  lStrPayment = (mtxAuction.Columns.Item("C_TotalC").Cells.Item(i + 1).Specific as EditText).Value.Trim();
                    decimal lDblPayment = Convert.ToDecimal(lStrPayment == "" ? "0" : lStrPayment);
                    DtMatrixAuctions.SetValue("C_TotalC", i, lDblPayment.ToString());
                    lDecPaymentPayment += lDblPayment;
                }
                decimal lDecPaymentSell = Convert.ToDecimal(DtMatrixSellers.GetValue("C_TotalS", mIntRowSelected - 1).ToString());
                DtMatrixSellers.SetValue("C_TotalC", mIntRowSelected - 1, lDecPaymentPayment.ToString());

                DtMatrixSellers.SetValue("C_Total", mIntRowSelected - 1, (lDecPaymentSell - lDecPaymentPayment).ToString());
                mtxSellers.LoadFromDataSource();
                mtxAuction.LoadFromDataSource();
            }
            catch (Exception ex)
            {
                UIApplication.ShowError("frmPayment (UpdateMatrix) " + ex.Message);
                LogService.WriteError("frmPayment (UpdateMatrix) " + ex.Message);
                LogService.WriteError(ex);
            }
            finally
            {
                this.UIAPIRawForm.Freeze(false);
            }
        }
Ejemplo n.º 2
0
        private void FillMatrix(List <PaymentDTO> pLstPaymentDTO)
        {
            try
            {
                DtMatrixSellers.Rows.Clear();
                int i = 0;
                this.UIAPIRawForm.Freeze(true);
                foreach (PaymentDTO lObjPaymentDTO in pLstPaymentDTO)
                {
                    DtMatrixSellers.Rows.Add();
                    DtMatrixSellers.SetValue("#", i, i + 1);
                    DtMatrixSellers.SetValue("C_Code", i, lObjPaymentDTO.CardCode);
                    DtMatrixSellers.SetValue("C_Name", i, lObjPaymentDTO.CardName);
                    DtMatrixSellers.SetValue("C_TotalS", i, lObjPaymentDTO.TotalSell);
                    DtMatrixSellers.SetValue("C_TotalB", i, lObjPaymentDTO.TotalBuy);
                    DtMatrixSellers.SetValue("C_TotalC", i, lObjPaymentDTO.TotalCharge == null ? "0" : lObjPaymentDTO.TotalCharge);
                    DtMatrixSellers.SetValue("C_Total", i, lObjPaymentDTO.Total == null ? "0" : lObjPaymentDTO.Total);
                    DtMatrixSellers.SetValue("C_AccountD", i, lObjPaymentDTO.AccountD);
                    DtMatrixSellers.SetValue("C_AccountC", i, lObjPaymentDTO.AccountC);
                    i++;
                }

                mtxSellers.Columns.Item("#").DataBind.Bind("DsPayments", "#");
                mtxSellers.Columns.Item("C_Code").DataBind.Bind("DsPayments", "C_Code");
                mtxSellers.Columns.Item("C_Name").DataBind.Bind("DsPayments", "C_Name");
                mtxSellers.Columns.Item("C_TotalS").DataBind.Bind("DsPayments", "C_TotalS");
                mtxSellers.Columns.Item("C_TotalB").DataBind.Bind("DsPayments", "C_TotalB");
                mtxSellers.Columns.Item("C_TotalC").DataBind.Bind("DsPayments", "C_TotalC");
                mtxSellers.Columns.Item("C_Total").DataBind.Bind("DsPayments", "C_Total");
                mtxSellers.LoadFromDataSource();
                mtxSellers.AutoResizeColumns();
            }
            catch (Exception ex)
            {
                UIApplication.ShowError("frmPayment (FillMatrix) " + ex.Message);
                LogService.WriteError("frmPayment (FillMatrix) " + ex.Message);
                LogService.WriteError(ex);
            }
            finally
            {
                this.UIAPIRawForm.Freeze(false);
            }
        }