private void FillMatrix(List <Vouchers> pLstVouchers) { try { int i = 0; this.UIAPIRawForm.Freeze(true); foreach (Vouchers lObjVoucher in pLstVouchers) { DtMatrix.Rows.Add(); DtMatrix.SetValue("#", i, i + 1); DtMatrix.SetValue("C_RowCode", i, lObjVoucher.RowCode); DtMatrix.SetValue("C_Folio", i, lObjVoucher.Folio); DtMatrix.SetValue("C_Status", i, lObjVoucher.Status); DtMatrix.SetValue("C_StatusDescription", i, ((StatusEnum)lObjVoucher.Status).GetDescription()); DtMatrix.SetValue("C_Area", i, lObjVoucher.Area); DtMatrix.SetValue("C_Employe", i, lObjVoucher.Employee); DtMatrix.SetValue("C_Date", i, lObjVoucher.Date); DtMatrix.SetValue("C_Amount", i, lObjVoucher.Total); i++; } mtxRefound.Columns.Item("#").DataBind.Bind("DsVouchers", "#"); mtxRefound.Columns.Item("C_Folio").DataBind.Bind("DsVouchers", "C_Folio"); mtxRefound.Columns.Item("C_Status").DataBind.Bind("DsVouchers", "C_StatusDescription"); mtxRefound.Columns.Item("C_Area").DataBind.Bind("DsVouchers", "C_Area"); mtxRefound.Columns.Item("C_Employe").DataBind.Bind("DsVouchers", "C_Employe"); mtxRefound.Columns.Item("C_Date").DataBind.Bind("DsVouchers", "C_Date"); mtxRefound.Columns.Item("C_Amount").DataBind.Bind("DsVouchers", "C_Amount"); mtxRefound.LoadFromDataSource(); mtxRefound.AutoResizeColumns(); this.UIAPIRawForm.Freeze(false); } catch (Exception ex) { this.UIAPIRawForm.Freeze(false); UIApplication.ShowMessageBox(ex.Message); LogService.WriteError("frmSearchRefunds (frmPurchaseNotes) " + ex.Message); LogService.WriteError(ex); } finally { this.UIAPIRawForm.Freeze(false); } }
private void FillMatrix() { try { this.UIAPIRawForm.Freeze(true); if (DtMatrix != null) { DtMatrix.Rows.Clear(); } List <PaymentDTO> lLstPaymentDTO = mObjPurchasesServiceFactory.GetPurchaseCheeckingCostService().GetPayment(txtArea.Value, cboStatus.Value).ToList(); int i = 0; foreach (PaymentDTO lObjPaymentDTO in lLstPaymentDTO) { DtMatrix.Rows.Add(); DtMatrix.SetValue("#", i, i + 1); /*DtMatrix.SetValue("C_DocEntry", i, lObjPaymentDTO.DocEntry); * DtMatrix.SetValue("C_DocNum", i, lObjPaymentDTO.DocNum);*/ DtMatrix.SetValue("C_Folio", i, lObjPaymentDTO.Folio); string lStrStatus = ""; if (lObjPaymentDTO.Status == "0" || lObjPaymentDTO.Status == "") { lStrStatus = ""; } else { StatusEnum lObjStatusEnum = (StatusEnum)Convert.ToInt16(lObjPaymentDTO.Status); lStrStatus = lObjStatusEnum.GetDescription(); } DtMatrix.SetValue("C_Status", i, lObjPaymentDTO.Status); int lIntStatus = 0; if (int.TryParse(lObjPaymentDTO.Status, out lIntStatus)) { lIntStatus = Convert.ToInt32(lObjPaymentDTO.Status); } DtMatrix.SetValue("C_Status", i, lIntStatus.ToString()); DtMatrix.SetValue("C_StatusDescription", i, lStrStatus); DtMatrix.SetValue("C_EmpId", i, lObjPaymentDTO.EmpId); DtMatrix.SetValue("C_Employe", i, lObjPaymentDTO.Employee); DtMatrix.SetValue("C_Area", i, lObjPaymentDTO.Area); // DtMatrix.SetValue("C_Date", i, Convert.ToDateTime(lObjPaymentDTO.Date)); DtMatrix.SetValue("C_ImpSol", i, lObjPaymentDTO.ImpSol); DtMatrix.SetValue("C_ImpComp", i, lObjPaymentDTO.ImpComp); DtMatrix.SetValue("C_ImpFalt", i, lObjPaymentDTO.ImpFalt); DtMatrix.SetValue("C_ImpSob", i, lObjPaymentDTO.ImpSob); DtMatrix.SetValue("C_SaldoPen", i, lObjPaymentDTO.SaldoPen); i++; } mtxCosts.Columns.Item("#").DataBind.Bind("PaymentsDataTable", "#"); mtxCosts.Columns.Item("C_Folio").DataBind.Bind("PaymentsDataTable", "C_Folio"); //mtxCosts.Columns.Item("C_DocEntry").DataBind.Bind("PaymentsDataTable", "C_DocNum"); mtxCosts.Columns.Item("C_Status").DataBind.Bind("PaymentsDataTable", "C_StatusDescription"); mtxCosts.Columns.Item("C_Employe").DataBind.Bind("PaymentsDataTable", "C_Employe"); mtxCosts.Columns.Item("C_Area").DataBind.Bind("PaymentsDataTable", "C_Area"); //mtxCosts.Columns.Item("C_Date").DataBind.Bind("PaymentsDataTable", "C_Date"); mtxCosts.Columns.Item("C_ImpSol").DataBind.Bind("PaymentsDataTable", "C_ImpSol"); mtxCosts.Columns.Item("C_ImpComp").DataBind.Bind("PaymentsDataTable", "C_ImpComp"); mtxCosts.Columns.Item("C_ImpFalt").DataBind.Bind("PaymentsDataTable", "C_ImpFalt"); mtxCosts.Columns.Item("C_ImpSob").DataBind.Bind("PaymentsDataTable", "C_ImpSob"); mtxCosts.Columns.Item("C_SaldoPen").DataBind.Bind("PaymentsDataTable", "C_SaldoPen"); mtxCosts.LoadFromDataSource(); mtxCosts.AutoResizeColumns(); this.UIAPIRawForm.Freeze(false); LogService.WriteInfo("(frmCheckingCost) Matriz Cargada correctamente: Area " + txtArea.Value + ", Estatus " + cboStatus.Value); } catch (Exception ex) { this.UIAPIRawForm.Freeze(false); UIApplication.ShowMessageBox(ex.Message); LogService.WriteError("(FillMatrix): " + ex.Message); LogService.WriteError(ex); } finally { this.UIAPIRawForm.Freeze(false); } }