private BindingSource NewMethodFpago() { tb_co_tabla01_mediopagoBL BL = new tb_co_tabla01_mediopagoBL(); tb_co_tabla01_mediopago BE = new tb_co_tabla01_mediopago(); DataTable table = BL.GetAll(VariablesPublicas.EmpresaID.ToString(), BE).Tables[0]; DataRowCollection rows = table.Rows; object[] cell; Dictionary<string, string> dic = new Dictionary<string, string>(); BindingSource binding = new BindingSource(); foreach (DataRow item in rows) { cell = item.ItemArray; dic.Add(cell[0].ToString(), cell[0].ToString() + " - " + cell[1].ToString()); cell = null; } binding.DataSource = dic; return binding; }
void Calculos_CronogramaPagos() { // Agregar las Filas Deacuerdo al Numero de Documento ArmarTablaCronoPagos(); //TablaCronoPagos = (DataTable)Session["TablaCronoPagos"]; Int16 ndocs = Convert.ToInt16(spe_numdocs.Text); Int16 nitem = 0; Decimal xtot = (Convert.ToDecimal(txt_imponeto.Text) / ndocs); // Aplicar Logica Para Colocar Las Fechas DeAcuerdo la Plazo de Dias --- Partiendo desde la Fecha de Entrega DateTime fecha = Convert.ToDateTime(fechentrega.Text); fecha = fecha.AddDays(30); Int32 num = 0, num2 = 0; //************************************** Calculo Para Fechas Siguientes DateTime fecha2 = DateTime.Today; Int32 xtotfech2 = 0; if (ndocs > 1) { Int32 xndias = Convert.ToInt32(cmb_plazoday.Value); xtotfech2 = ((xndias - 30) / (ndocs - 1)); fecha2 = fecha.AddDays(xtotfech2); } //******************************************************************** tb_co_tabla01_mediopagoBL BL = new tb_co_tabla01_mediopagoBL(); tb_co_tabla01_mediopago BE = new tb_co_tabla01_mediopago(); DataTable dt = new DataTable(); BE.codigoid = cmb_mediopagoid.Value.ToString(); dt = BL.GetAll(Session["ssEmpresaID"].ToString(), BE).Tables[0]; if (dt.Rows.Count > 0) { for (int i = 0; i < ndocs; i++) { nitem++; row = TablaCronoPagos.NewRow(); row["tipdoc"] = txt_tipdoc.Text; row["serdoc"] = txt_serdoc.Text; row["numdoc"] = txt_numdoc.Text; row["mediopagoid"] = cmb_mediopagoid.Value.ToString(); row["item"] = Convert.ToString(nitem).PadLeft(2, '0'); row["num_interno"] = dt.Rows[0]["sigla"].ToString() + " - " + Convert.ToString(nitem).PadLeft(2, '0'); row["num_unico"] = ""; row["monto"] = Convert.ToString(xtot); if (nitem == 1) { row["fechven"] = Convert.ToString(fecha); } else { if (num == 0) { row["fechven"] = Convert.ToString(fecha2); num++; } else { num2++; row["fechven"] = Convert.ToString(fecha2.AddDays(xtotfech2 * num2)); } } row["usuar"] = VariablesPublicas.Usuar; TablaCronoPagos.Rows.Add(row); } gridcronpagos.DataSource = TablaCronoPagos; gridcronpagos.DataBind(); Session["TablaCronoPagos"] = TablaCronoPagos; //btn_grabar.CssClass = "boton_grabar2"; } }
private void CargarComboMedioPago() { tb_co_tabla01_mediopagoBL BL = new tb_co_tabla01_mediopagoBL(); tb_co_tabla01_mediopago BE = new tb_co_tabla01_mediopago(); DataTable dt = new DataTable(); dt = BL.GetAll(Session["ssEmpresaID"].ToString(), BE).Tables[0]; if (dt.Rows.Count > 0) { cmb_mediopagoid.DataSource = dt; cmb_mediopagoid.ValueField = "codigoid"; cmb_mediopagoid.TextField = "descripcion"; cmb_mediopagoid.DataBind(); } }
public bool Validacion() { string xmsg = ""; decimal ntotmarcados = VariablesPublicas.StringtoDecimal(lbltotregistros.Text); string xcodigo = "..."; decimal vmnpagosoles = 0; decimal vmnpagodolares = 0; int ncontador = 0; decimal vmncambio = VariablesPublicas.StringtoDecimal(txtTipCamb.Text); if (ntotmarcados == 0) { xmsg = "Seleccione al menos 1 documento a cancelar"; } else { vmnpagosoles = VariablesPublicas.StringtoDecimal(lbltotalpagosoles.Text); vmnpagodolares = VariablesPublicas.StringtoDecimal(lbltotalpagodolares.Text); if (vmnpagosoles == 0 & vmnpagodolares == 0) { xmsg = "Digite montos a cancelar"; } else { if (txtCodsubdiario.Text.Trim().Length > 0) { xcodigo = txtCodsubdiario.Text; } try { DataTable cursortipvoucher = new DataTable(); tb_co_tipodiarioBL BL = new tb_co_tipodiarioBL(); tb_co_tipodiario BE = new tb_co_tipodiario(); BE.perianio = VariablesPublicas.perianio; BE.diarioid = xcodigo; cursortipvoucher = BL.GetAll(VariablesPublicas.EmpresaID.ToString(), BE).Tables[0]; } catch (Exception ex) { XtraMessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } if (tmptabla.Rows.Count == 0) { xmsg = "Ingrese Sub-Diario "; } if (txtcuentaid.Text.Trim().Length == 0) { xmsg = "Sub-Diario no relacinado con cuenta contable"; } } } if (vmncambio == 0) { xmsg = "Ingrese tipo de cambio"; txtTipCamb.Focus(); } DataTable cursorformaspagos = new DataTable(); try { tb_co_tabla01_mediopagoBL BL = new tb_co_tabla01_mediopagoBL(); tb_co_tabla01_mediopago BE = new tb_co_tabla01_mediopago(); BE.codigoid = cboFpago.SelectedValue.ToString(); cursorformaspagos = BL.GetAll(VariablesPublicas.EmpresaID.ToString(), BE).Tables[0]; } catch (Exception ex) { XtraMessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } if (cursorformaspagos.Rows.Count == 0) { xmsg = "Seleccione Medio de Pago"; cboFpago.Focus(); } if (txtNumpago.Text.Trim().Length == 0) { xmsg = "Ingrese Nº de Cheque/Operación"; txtNumpago.Focus(); } DataTable cursorfefectivo = new DataTable(); string xFefectivo = ".."; if (cboFefectivo.Text.ToString().Trim().Length > 0) { xFefectivo = cboFefectivo.SelectedValue.ToString(); } try { tb_co_FlujoefectivoBL BL = new tb_co_FlujoefectivoBL(); tb_co_Flujoefectivo BE = new tb_co_Flujoefectivo(); BE.fefectivoid = xFefectivo; cursorfefectivo = BL.GetAll(VariablesPublicas.EmpresaID.ToString(), BE).Tables[0]; } catch (Exception ex) { XtraMessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } if (cursorfefectivo.Rows.Count == 0) { xmsg = "Seleccione Flujo de Efectivo"; cboFefectivo.Focus(); } // Validan Detalles seleccinados if (xmsg.Length == 0) { for (ncontador = 0; ncontador <= DocumentosPendientes.Rows.Count - 1; ncontador++) { if (Convert.ToBoolean(DocumentosPendientes.Rows[ncontador]["selecciona"]) == true) { if (Convert.ToDecimal(DocumentosPendientes.Rows[ncontador]["pagosoles"]) == 0 & Convert.ToDecimal(DocumentosPendientes.Rows[ncontador]["pagodolares"]) == 0) { xmsg = "Ingrese monto a cancelar"; if (DocumentosPendientes.Rows[ncontador]["monedap"].ToString() == "1") { examinar.CurrentCell = examinar.Rows[ncontador].Cells["pagosoles"]; } else { examinar.CurrentCell = examinar.Rows[ncontador].Cells["pagodolares"]; } examinar.CurrentCell.ReadOnly = true; examinar.BeginEdit(true); examinar.CurrentCell.ReadOnly = false; break; } } } } if (xmsg.Length == 0) { if (!PuedeEditarEliminar(" Grabar Asiento Tesoreria ", VariablesPublicas.PADL(fEmision.Value.Month.ToString(), 2, "0"))) { xmsg = "..."; } } if (xmsg.Length > 0 & !(xmsg == "...")) { XtraMessageBox.Show(xmsg, "Validación", MessageBoxButtons.OK, MessageBoxIcon.Question); } return xmsg.Length == 0; }