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); } }
private void FillMatrixAuction(List <AuctionsDTO> pLstAuctionDTO) { try { DtMatrixAuctions.Rows.Clear(); int i = 0; this.UIAPIRawForm.Freeze(true); foreach (AuctionsDTO lObjAuction in pLstAuctionDTO) { DtMatrixAuctions.Rows.Add(); DtMatrixAuctions.SetValue("#", i, i + 1); DtMatrixAuctions.SetValue("C_Auction", i, lObjAuction.Folio); DtMatrixAuctions.SetValue("C_TotalB", i, lObjAuction.TotalBuyer); DtMatrixAuctions.SetValue("C_TotalC", i, lObjAuction.TotalCharge == null ? "0" : lObjAuction.TotalCharge); i++; } mtxAuction.Columns.Item("#").DataBind.Bind("DsAuctions", "#"); mtxAuction.Columns.Item("C_Auction").DataBind.Bind("DsAuctions", "C_Auction"); mtxAuction.Columns.Item("C_TotalB").DataBind.Bind("DsAuctions", "C_TotalB"); mtxAuction.Columns.Item("C_TotalC").DataBind.Bind("DsAuctions", "C_TotalC"); mtxAuction.LoadFromDataSource(); mtxAuction.AutoResizeColumns(); } catch (Exception ex) { UIApplication.ShowError("frmPayment (FillMatrixAuction) " + ex.Message); LogService.WriteError("frmPayment (FillMatrixAuction) " + ex.Message); LogService.WriteError(ex); } finally { this.UIAPIRawForm.Freeze(false); } }