private void FgItems_CellChanged(object sender, C1.Win.C1FlexGrid.RowColEventArgs e) { if (n_QueHace == 3) { return; } double n_valor = 0; double n_precio = 0; double n_tasigv = 0; if (FgItems.Col == 4) { n_valor = Convert.ToDouble(FgItems.GetData(e.Row, 4)); n_tasigv = Convert.ToDouble(FgItems.GetData(e.Row, 5)); n_precio = n_valor * ((n_tasigv / 100) + 1); FgItems.SetData(e.Row, 6, n_precio.ToString("0.00")); } if (FgItems.Col == 6) { n_valor = Convert.ToDouble(FgItems.GetData(e.Row, 6)); n_tasigv = Convert.ToDouble(FgItems.GetData(e.Row, 5)); n_precio = n_valor / ((n_tasigv / 100) + 1); FgItems.SetData(e.Row, 4, n_precio.ToString("0.00")); } }
private void FgItems_CellChanged(object sender, C1.Win.C1FlexGrid.RowColEventArgs e) { if (booAgregando == true) { return; } if (n_QueHace == 3) { return; } if (e.Col == 6) { string c_valor = FgItems.GetData(FgItems.Row, 6).ToString(); FgItems.SetData(FgItems.Row, 7, Convert.ToDouble(c_valor).ToString("0.00")); Calcular(FgItems.Row); } if (e.Col == 7) { string c_valor = FgItems.GetData(FgItems.Row, 7).ToString(); FgItems.SetData(FgItems.Row, 6, Convert.ToDouble(c_valor).ToString("0.00")); Calcular(FgItems.Row); } SumarColumnas(); }
private void FgItems_EnterCell(object sender, EventArgs e) { if (b_agregando == true) { return; } if ((FgItems.Col == 6) || (FgItems.Col == 7) || (FgItems.Col == 8)) { if (funFunciones.NulosC(FgItems.GetData(FgItems.Row, 9)) == "True") { FgItems.AllowEditing = true; } else { FgItems.AllowEditing = false; } } else { FgItems.AllowEditing = false; } if (FgItems.Col == 9) { FgItems.AllowEditing = true; } }
void MostrarPedidos() { int n_row = 0; CN_vta_pedidocen miFun = new CN_vta_pedidocen(); DataTable dtLista = new DataTable(); miFun.mysConec = mysConec; b_agregando = true; miFun.TraerPendienteEnvio(STU_SISTEMA.EMPRESAID, STU_SISTEMA.MESTRABAJO, STU_SISTEMA.ANOTRABAJO); dtLista = miFun.dtLista; if (dtLista.Rows.Count == 0) { MessageBox.Show("¡ No hay pedidos pendiente, no se puede emitir guias !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); return; } FgItems.Rows.Count = 2; for (n_row = 0; n_row <= dtLista.Rows.Count - 1; n_row++) { FgItems.Rows.Count = FgItems.Rows.Count + 1; FgItems.SetData(FgItems.Rows.Count - 1, 1, dtLista.Rows[n_row]["c_numped"].ToString()); FgItems.SetData(FgItems.Rows.Count - 1, 2, dtLista.Rows[n_row]["d_fchemi"].ToString()); FgItems.SetData(FgItems.Rows.Count - 1, 3, dtLista.Rows[n_row]["d_fchent"].ToString()); FgItems.SetData(FgItems.Rows.Count - 1, 4, dtLista.Rows[n_row]["c_punvendes"].ToString()); FgItems.SetData(FgItems.Rows.Count - 1, 5, dtLista.Rows[n_row]["c_punentdes"].ToString()); FgItems.SetData(FgItems.Rows.Count - 1, 10, dtLista.Rows[n_row]["n_id"].ToString()); FgItems.SetData(FgItems.Rows.Count - 1, 11, dtLista.Rows[n_row]["n_idcli"].ToString()); } TxtPunVen.Text = FgItems.GetData(FgItems.Row, 4).ToString(); TxtPunEnt.Text = FgItems.GetData(FgItems.Row, 5).ToString(); b_agregando = false; }
void AsignarEntidad() { if (FgItems.Rows.Count == 2) { MessageBox.Show("¡ No hay items que guardar, debe de agregar almenos un item !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); return; } int n_fil = 0; int n_idcli = Convert.ToInt32(DgLista.Columns["n_id"].CellValue(DgLista.Row).ToString()); // OBTENEMOS EL ID DEL REGISTRO QUE SE DESEA ELIMINAR l_Items.Clear(); for (n_fil = 2; n_fil <= FgItems.Rows.Count - 1; n_fil++) { BE_MAE_CLIPROITEMS e_Items = new BE_MAE_CLIPROITEMS(); e_Items.n_idcli = n_idcli; e_Items.n_idite = Convert.ToInt32(FgItems.GetData(n_fil, 7)); e_Items.n_prebru = Convert.ToDouble(FgItems.GetData(n_fil, 4)); e_Items.n_prenet = Convert.ToDouble(FgItems.GetData(n_fil, 6)); e_Items.n_tasigv = Convert.ToDouble(FgItems.GetData(n_fil, 5)); l_Items.Add(e_Items); } }
private void CmdAddItem_Click(object sender, EventArgs e) { bool booAgregarUnidad = true; if (Convert.ToString(FgItems.GetData(FgItems.Rows.Count - 1, 1)) == "") { booAgregarUnidad = false; } if (Convert.ToString(FgItems.GetData(FgItems.Rows.Count - 1, 2)) == "") { booAgregarUnidad = false; } if (Convert.ToString(FgItems.GetData(FgItems.Rows.Count - 1, 3)) == "") { booAgregarUnidad = false; } if (Convert.ToString(FgItems.GetData(FgItems.Rows.Count - 1, 4)) == "") { booAgregarUnidad = false; } if (booAgregarUnidad == true) { FgItems.Rows.Count = FgItems.Rows.Count + 1; //FgItems.Cols[5].DataType = typeof(bool); //FgItems.SetData(FgItems.Rows.Count - 1, 5, false); FgItems.Focus(); } else { MessageBox.Show("No puede agregar mas items hasta que no haya completado el item anterior", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); } }
void AsignarEntidad() { BE_Transferencia = new BE_ALM_TRANSFERENCIAS(); BE_Transferencia.n_idemp = STU_SISTEMA.EMPRESAID; BE_Transferencia.d_fchdoc = Convert.ToDateTime(TxtFchDoc.Text); BE_Transferencia.d_fching = Convert.ToDateTime(txtFchIng.Text); BE_Transferencia.c_numser = TxtNumSer.Text; BE_Transferencia.c_numdoc = TxtNumDoc.Text; BE_Transferencia.n_idalmorig = Convert.ToInt32(CboAlmacenOrigen.SelectedValue); BE_Transferencia.n_idalmdest = Convert.ToInt32(CboAlmacenDestino.SelectedValue); BE_Transferencia.n_anotra = STU_SISTEMA.ANOTRABAJO; BE_Transferencia.n_idmes = STU_SISTEMA.MESTRABAJO; BE_Transferencia.c_obs = TxtObs.Text;; BE_Transferencia.n_idresp = Convert.ToInt32(CboResponsable.SelectedValue); booAgregando = true; if (FgItems.Rows.Count > 2) { int n_fila; for (n_fila = 2; n_fila <= FgItems.Rows.Count - 1; n_fila++) { if (funFunciones.NulosC(FgItems.GetData(n_fila, 1)) != "") { BE_ALM_TRANSFERENCIASDET BE_Detalle = new BE_ALM_TRANSFERENCIASDET(); BE_Detalle.n_idtrans = 0; BE_Detalle.n_can = Convert.ToDouble(FgItems.GetData(n_fila, 6).ToString()); string c_tipexides = FgItems.GetData(n_fila, 1).ToString(); string c_itedes = FgItems.GetData(n_fila, 2).ToString(); string c_itepredes = FgItems.GetData(n_fila, 3).ToString(); BE_Detalle.c_numlot = funFunciones.NulosC(FgItems.GetData(n_fila, 4)); DataTable DtFiltro = new DataTable(); // FILTRAMOS EL ITEM DE LA FILA PARA OBTENER EL ID string strCadenaFiltro = "c_despro = '" + c_itedes + "'"; DtFiltro = funDatos.DataTableFiltrar(dtItems, strCadenaFiltro); BE_Detalle.n_idite = Convert.ToInt32(DtFiltro.Rows[0]["n_id"].ToString()); // FILTRAMOS LA PRESENTACION PARA OBTENER SU ID strCadenaFiltro = "c_abrpre = '" + c_itepredes + "' AND n_idite = " + BE_Detalle.n_idite + ""; DtFiltro = funDatos.DataTableFiltrar(dtPresentaItem, strCadenaFiltro); BE_Detalle.n_idpre = Convert.ToInt32(DtFiltro.Rows[0]["n_id"].ToString()); // FILTRAMOS EL TIPO DE PRODUCTO PARA OBTENER SU id strCadenaFiltro = "c_des = '" + c_tipexides + "'"; DtFiltro = funDatos.DataTableFiltrar(dtTipoExis, strCadenaFiltro); BE_Detalle.n_idtippro = Convert.ToInt32(DtFiltro.Rows[0]["n_id"].ToString()); BE_Detalle.h_horsal = funFunciones.NulosC(FgItems.GetData(n_fila, 9)); BE_Detalle.n_preuni = Convert.ToDouble(FgItems.GetData(n_fila, 7)); BE_Detalle.n_pretot = Convert.ToDouble(FgItems.GetData(n_fila, 8)); BE_Transferencia.lst_items.Add(BE_Detalle); } } } booAgregando = false; }
void Calcular(int n_row) { double n_valor = Convert.ToDouble(FgItems.GetData(n_row, 7).ToString()); double n_tasa = Convert.ToDouble(TxtTasRet.Text); n_valor = (n_valor * (n_tasa / 100)); FgItems.SetData(n_row, 9, n_valor.ToString("0.00")); }
private void CmdAddIte_Click(object sender, EventArgs e) { if (funFunciones.NulosC(FgItems.GetData(FgItems.Rows.Count - 1, 1)) == "") { return; } FgItems.Rows.Count = FgItems.Rows.Count + 1; }
private void FgItems_EnterCell(object sender, EventArgs e) { if (n_QueHace == 3) { FgItems.AllowEditing = false; return; } if (booAgregando == true) { return; } DataTable dtResul = new DataTable(); int n_idtipproducto = 0; string strDesTipPro = ""; if (FgItems.Col == 1) { // OBTNEMOS LA DESCRIPCION DEL TIPO DE PRODUCTO n_idtipproducto = Convert.ToInt16(CboTipPro.SelectedValue); dtResul = funDatos.DataTableFiltrar(dtItems, "n_idtipexi = " + n_idtipproducto + ""); funFlex.FlexColumnaCombo(FgItems, dtResul, "c_despro", 1); // ITEMS } if (FgItems.Col == 2) { // OBTENEMOS LA DESCRIPCIO DEL ITEM strDesTipPro = funFunciones.NulosC(FgItems.GetData(FgItems.Row, 1)); if (strDesTipPro == "") { FgItems.AllowEditing = false; funFlex.FlexColumnaCombo(FgItems, dtResul, "c_despro", 2); return; } // OBTENEMOS EL ID DEL TIPO DE PRODUCTO dtResul = funDatos.DataTableFiltrar(dtItems, "c_despro = '" + strDesTipPro + "'"); n_idtipproducto = Convert.ToInt16(dtResul.Rows[0]["n_id"].ToString()); // FILTRAMOS LAS PRESENTACIONES DEL ITEM SELECCIONADO dtResul = funDatos.DataTableFiltrar(dtPresentaItem, "n_idite = " + n_idtipproducto + ""); funFlex.FlexColumnaCombo(FgItems, dtResul, "c_des", 2); // ITEMS } if ((FgItems.Col == 3) || (FgItems.Col == 4) || (FgItems.Col == 5)) { FgItems.AllowEditing = true; } if (FgItems.Col == 6) { FgItems.AllowEditing = false; return; } FgItems.AllowEditing = true; }
private void CmdAddItem_Click(object sender, EventArgs e) { // AGREGAMOS EL AÑO SELECCIONADO + EL PORCENTAJE ASIGNADO string c_dato = ""; double n_valor = 0; double n_porcen = Convert.ToDouble(funFunciones.NulosN(TxtPor.Text)); n_porcen = ((n_porcen / 100) + 1); n_valor = Convert.ToDouble(FgItems.GetData(FgItems.Row, 2)); c_dato = (n_valor * n_porcen).ToString("0.00"); FgDato.SetData(2, 2, c_dato); n_valor = Convert.ToDouble(FgItems.GetData(FgItems.Row, 3)); c_dato = (n_valor * n_porcen).ToString("0.00"); FgDato.SetData(2, 3, c_dato); n_valor = Convert.ToDouble(FgItems.GetData(FgItems.Row, 4)); c_dato = (n_valor * n_porcen).ToString("0.00"); FgDato.SetData(2, 4, c_dato); n_valor = Convert.ToDouble(FgItems.GetData(FgItems.Row, 5)); c_dato = (n_valor * n_porcen).ToString("0.00"); FgDato.SetData(2, 5, c_dato); n_valor = Convert.ToDouble(FgItems.GetData(FgItems.Row, 6)); c_dato = (n_valor * n_porcen).ToString("0.00"); FgDato.SetData(2, 6, c_dato); n_valor = Convert.ToDouble(FgItems.GetData(FgItems.Row, 7)); c_dato = (n_valor * n_porcen).ToString("0.00"); FgDato.SetData(2, 7, c_dato); n_valor = Convert.ToDouble(FgItems.GetData(FgItems.Row, 8)); c_dato = (n_valor * n_porcen).ToString("0.00"); FgDato.SetData(2, 8, c_dato); n_valor = Convert.ToDouble(FgItems.GetData(FgItems.Row, 9)); c_dato = (n_valor * n_porcen).ToString("0.00"); FgDato.SetData(2, 9, c_dato); n_valor = Convert.ToDouble(FgItems.GetData(FgItems.Row, 10)); c_dato = (n_valor * n_porcen).ToString("0.00"); FgDato.SetData(2, 10, c_dato); n_valor = Convert.ToDouble(FgItems.GetData(FgItems.Row, 11)); c_dato = (n_valor * n_porcen).ToString("0.00"); FgDato.SetData(2, 11, c_dato); n_valor = Convert.ToDouble(FgItems.GetData(FgItems.Row, 12)); c_dato = (n_valor * n_porcen).ToString("0.00"); FgDato.SetData(2, 12, c_dato); n_valor = Convert.ToDouble(FgItems.GetData(FgItems.Row, 13)); c_dato = (n_valor * n_porcen).ToString("0.00"); FgDato.SetData(2, 13, c_dato); }
private void FgItems_RowColChange(object sender, EventArgs e) { if (b_agregando == true) { return; } TxtPunVen.Text = FgItems.GetData(FgItems.Row, 4).ToString(); TxtPunEnt.Text = FgItems.GetData(FgItems.Row, 5).ToString(); }
private void FgItems_KeyUp(object sender, KeyEventArgs e) { if (e.KeyCode.ToString() == "Delete") { if (funFunciones.NulosC(FgItems.GetData(FgItems.Row, 2)) != "") { FgItems.RemoveItem(FgItems.Row); } } }
private void FgItems_CellButtonClick(object sender, C1.Win.C1FlexGrid.RowColEventArgs e) { if (FgItems.Col == 2) { int n_idtipexi = 3; DataTable dtResul = new DataTable(); string c_dato = ""; // OBTNEMOS LA DESCRIPCION DEL TIPO DE PRODUCTO string strDesTipPro = funFunciones.NulosC(FgItems.GetData(FgItems.Row, 1)); if (strDesTipPro == "") { n_idtipexi = 0; } // OBTENEMOS EL ID DEL TIPO DE PRODUCTO dtResul = funDatos.DataTableFiltrar(dtTipoExis, "c_des = '" + strDesTipPro + "'"); if (dtResul.Rows.Count != 0) { n_idtipexi = Convert.ToInt32(dtResul.Rows[0]["n_id"].ToString()); } booAgregando = true; dtResul = objItems.BuscarItem("", "n_id", dtItems, n_idtipexi); if (dtResul != null) { if (dtResul.Rows.Count != 0) { c_dato = dtResul.Rows[0]["c_despro"].ToString(); // MOSTRAMOS LA DESCRIPCION DEL ITEM FgItems.SetData(FgItems.Row, 2, c_dato); c_dato = dtResul.Rows[0]["n_id"].ToString(); // MOSTRAMOS LA PRESENTACION DEL ITEM c_dato = funDatos.DataTableBuscar(dtPresentaItem, "n_idite", "c_abrpre", c_dato, "N").ToString(); FgItems.SetData(FgItems.Row, 3, c_dato); } } booAgregando = false; } if (n_QueHace == 3) { FgItems.AllowEditing = false; return; } if (booAgregando == true) { return; } if (FgItems.Col == 5) { FgItems.Select(FgItems.Row - 1, 2); return; } }
void AsignarEntidad() { e_boleta.n_idemp = STU_SISTEMA.EMPRESAID; if (n_QueHace == 1) { e_boleta.n_id = 0; } if (n_QueHace == 2) { int n_idreg = Convert.ToInt32(DgLista.Columns["n_id"].CellValue(DgLista.Row).ToString()); e_boleta.n_id = n_idreg; } e_boleta.n_ano = STU_SISTEMA.ANOTRABAJO; e_boleta.n_mes = STU_SISTEMA.MESTRABAJO; e_boleta.d_fchdoc = Convert.ToDateTime(TxtFchDec.Text); e_boleta.d_fchven = Convert.ToDateTime(TxtFchEmiDoc.Text); e_boleta.n_idtipdoc = Convert.ToInt32(CboDoc.SelectedValue); e_boleta.n_numdoc = Convert.ToInt32(LblNumDoc.Text); e_boleta.n_importe = 0; e_boleta.n_numarc = Convert.ToInt32(TxtNumArchGen.Text); int n_row = 0; int n_iddoc = 0; double n_impbru = 0; double n_impigv = 0; double n_imptot = 0; l_boletadet.Clear(); for (n_row = 2; n_row <= FgItems.Rows.Count - 1; n_row++) { BE_VTA_BOLETARESUMENDET e_boletadet = new BE_VTA_BOLETARESUMENDET(); n_iddoc = Convert.ToInt32(FgItems.GetData(n_row, 15)); n_impbru = Convert.ToDouble(FgItems.GetData(n_row, 12)); n_impigv = Convert.ToDouble(FgItems.GetData(n_row, 13)); n_imptot = Convert.ToDouble(FgItems.GetData(n_row, 14)); e_boletadet.n_idres = 0; e_boletadet.n_iddoc = n_iddoc; e_boletadet.n_impbru = n_impbru; e_boletadet.n_impigv = n_impigv; e_boletadet.n_imptot = n_imptot; l_boletadet.Add(e_boletadet); } }
void AsignarEntidad() { if (n_QueHace == 1) { e_Per.n_id = 0; } else { e_Per.n_id = Convert.ToInt32(DgLista.Columns["n_id"].CellValue(DgLista.Row).ToString()); } e_Per.n_idemp = STU_SISTEMA.EMPRESAID; e_Per.n_ano = STU_SISTEMA.ANOTRABAJO; e_Per.n_mes = Convert.ToInt32(CboMeses.SelectedValue); e_Per.n_idlib = 16; e_Per.n_idtipdoc = 86; e_Per.n_idper = Convert.ToInt32(CboTipRet.SelectedValue); e_Per.n_tas = Convert.ToDouble(TxtTasRet.Text); e_Per.n_tip = 1; e_Per.n_idcli = Convert.ToInt32(LblIdPro.Text); e_Per.c_numser = TxtNumSer.Text; e_Per.c_numdoc = TxtNumDoc.Text; e_Per.d_fchemi = Convert.ToDateTime(TxtFchEmi.Text); e_Per.d_fchreg = Convert.ToDateTime(TxtFchEmi.Text); e_Per.n_idmon = Convert.ToInt32(CboMon.SelectedValue); e_Per.n_impper = Convert.ToDouble(TxtTot2.Text); e_Per.c_glo = TxtGlo.Text; e_Per.n_tc = Convert.ToDouble(TxtTc.Text); e_Per.n_tipreg = n_TipoRegistro; l_PerDet.Clear(); int n_row = 0; for (n_row = 2; n_row <= FgItems.Rows.Count - 1; n_row++) { BE_CON_REGPERCEPCIONDET e_PerDet = new BE_CON_REGPERCEPCIONDET(); e_PerDet.n_idper = 0; e_PerDet.n_iddoc = Convert.ToInt32(FgItems.GetData(n_row, 10)); e_PerDet.n_impdoc = Convert.ToDouble(FgItems.GetData(n_row, 6)); e_PerDet.n_impper = Convert.ToDouble(FgItems.GetData(n_row, 9)); l_PerDet.Add(e_PerDet); } }
private void FgItems_CellChanged(object sender, C1.Win.C1FlexGrid.RowColEventArgs e) { if (n_QueHace == 3) { return; } //if ((FgItems.Col == 12) || (FgItems.Col == 13) || (FgItems.Col == 14)) if (FgItems.Col == 14) { double n_valor = Convert.ToDouble(funFunciones.NulosN(FgItems.GetData(FgItems.Row, 14))); double n_impbru = (n_valor / 1.18); double n_impigv = (n_valor - (n_valor / 1.18)); FgItems.SetData(FgItems.Row, 12, n_impbru.ToString("0.00")); FgItems.SetData(FgItems.Row, 13, n_impigv.ToString("0.00")); } }
private void ToolGrabar_Click(object sender, EventArgs e) { List <BE_CON_CERRARMES> l_cerrarmes = new List <BE_CON_CERRARMES>(); int n_row = 0; int n_idmodulo = Convert.ToInt32(CboModulo.SelectedValue); int n_idmes = 0; bool b_estado = false; for (n_row = 2; n_row <= FgItems.Rows.Count - 1; n_row++) { BE_CON_CERRARMES e_cerrarmes = new BE_CON_CERRARMES(); n_idmes = Convert.ToInt32(FgItems.GetData(n_row, 3)); b_estado = Convert.ToBoolean(FgItems.GetData(n_row, 2)); e_cerrarmes.n_idmod = n_idmodulo; e_cerrarmes.n_idmes = n_idmes; e_cerrarmes.n_idemp = STU_SISTEMA.EMPRESAID; if (b_estado == false) { e_cerrarmes.n_estado = 0; } if (b_estado == true) { e_cerrarmes.n_estado = 1; } l_cerrarmes.Add(e_cerrarmes); } if (objRegistros.Actualizar(l_cerrarmes) == true) { objRegistros.mysConec = mysConec; // CARGAMOS LOS DATOS DEL FORMULARIO objRegistros.Listar(STU_SISTEMA.EMPRESAID); dtLista = objRegistros.dtLista; ListarEstado(); MessageBox.Show("¡ El estado del modulo " + CboModulo.Text + " se actualizo con exito ! ", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); } else { MessageBox.Show("¡ No se pudo actualizar el registro por el siguiente motivo ! " + objRegistros.c_ErrorMensaje, "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); } }
private void FgItems_CellChanged(object sender, C1.Win.C1FlexGrid.RowColEventArgs e) { if (n_QueHace == 3) { FgItems.AllowEditing = false; return; } if (booAgregando == true) { return; } string c_dato = ""; if (FgItems.Col == 3) { c_dato = FgItems.GetData(FgItems.Row, 3).ToString(); c_dato = (Convert.ToDouble(c_dato) / Convert.ToDouble(LblTc.Text)).ToString("0.00"); FgItems.SetData(FgItems.Row, 5, c_dato); } if (FgItems.Col == 4) { c_dato = FgItems.GetData(FgItems.Row, 4).ToString(); c_dato = (Convert.ToDouble(c_dato) / Convert.ToDouble(LblTc.Text)).ToString("0.00"); FgItems.SetData(FgItems.Row, 6, c_dato); } if (FgItems.Col == 5) { c_dato = FgItems.GetData(FgItems.Row, 5).ToString(); c_dato = (Convert.ToDouble(c_dato) * Convert.ToDouble(LblTc.Text)).ToString("0.00"); FgItems.SetData(FgItems.Row, 3, c_dato); } if (FgItems.Col == 6) { c_dato = FgItems.GetData(FgItems.Row, 6).ToString(); c_dato = (Convert.ToDouble(c_dato) * Convert.ToDouble(LblTc.Text)).ToString("0.00"); FgItems.SetData(FgItems.Row, 4, c_dato); } SumarColumnas(); }
private void FgItems_CellChanged(object sender, C1.Win.C1FlexGrid.RowColEventArgs e) { if (n_QueHace == 3) { FgItems.AllowEditing = false; return; } DataTable dtResul = new DataTable(); string c_dato = ""; if (b_Agregando == true) { return; } if (FgItems.Col == 1) { // FILTRAMOS LAS PRESENTACIONES DEL ITEM SELECCIONADO c_dato = FgItems.GetData(FgItems.Row, 4).ToString(); // OBTENEMOS EL ID DEL ITEM dtResul = funDatos.DataTableFiltrar(dtUniMed, "n_idite = " + c_dato + ""); funFlex.FlexColumnaCombo(FgItems, dtResul, "c_abrpre", 2); // UNIDADES DEL MEDIDA DEL ITEMS FgItems.AllowEditing = true; FgItems.Select(FgItems.Row - 1, 2); return; } if (FgItems.Col == 2) { CalcularTotalFila(); FgItems.Select(FgItems.Row - 1, 4); return; } if (FgItems.Col == 4) { FgItems.Select(FgItems.Row - 1, 1); FgItems.SetData(FgItems.Row + 1, 1, FgItems.GetData(FgItems.Row, 1)); return; } }
void CalcularTotalFila() { double n_importe = Convert.ToDouble(FgItems.GetData(FgItems.Row, 2)); double n_impuesto = 0; b_Agregando = true; FgItems.SetData(FgItems.Row, 3, n_importe.ToString("0.00")); TxtImponible.Text = n_importe.ToString("0.00"); if (ChkAfecto.Checked == true) { n_impuesto = ((n_importe * ((n_por4ta / 100) + 1)) - n_importe); TxtImpuesto.Text = n_impuesto.ToString("0.00"); } else { TxtImpuesto.Text = "0.00"; } TxtImpTot.Text = (n_importe - n_impuesto).ToString("0.00"); b_Agregando = false; }
private void CmdAddProMen_Click(object sender, EventArgs e) { // AGREGAMOS EL PROMEDIO + EL PORCENTAJE ASIGNADO string c_dato = ""; double n_valor = Convert.ToDouble(funFunciones.NulosN(FgItems.GetData(FgItems.Row, 15))); c_dato = n_valor.ToString("0.00"); FgDato.SetData(2, 2, c_dato); FgDato.SetData(2, 3, c_dato); FgDato.SetData(2, 4, c_dato); FgDato.SetData(2, 5, c_dato); FgDato.SetData(2, 6, c_dato); FgDato.SetData(2, 7, c_dato); FgDato.SetData(2, 8, c_dato); FgDato.SetData(2, 9, c_dato); FgDato.SetData(2, 10, c_dato); FgDato.SetData(2, 11, c_dato); FgDato.SetData(2, 12, c_dato); FgDato.SetData(2, 13, c_dato); //FgDato.SetData(2, 14, c_dato); c_dato = (n_valor * 12).ToString("0.00"); FgDato.SetData(2, 14, c_dato); }
private void FgItems_KeyUp(object sender, KeyEventArgs e) { if (FgItems.Col == 1) { if (e.KeyCode.ToString() == "Delete") { booAgregando = true; FgItems.SetData(FgItems.Row, 1, ""); FgItems.SetData(FgItems.Row, 2, ""); FgItems.SetData(FgItems.Row, 3, ""); FgItems.SetData(FgItems.Row, 4, ""); FgItems.SetData(FgItems.Row, 5, ""); FgItems.SetData(FgItems.Row, 6, ""); //Calcularfila(FgItems.Row); booAgregando = false; } } if (e.KeyCode.ToString() == "Insert") { if (funFunciones.NulosC(FgItems.GetData(FgItems.Rows.Count - 1, 1)) == "") { return; } FgItems.Rows.Count = FgItems.Rows.Count + 1; } if (e.KeyCode.ToString() == "Delete") { if (FgItems.Rows.Count <= 2) { return; } FgItems.RemoveItem(FgItems.Row); } }
bool CamposOK() { bool booEstado = true; if (txtFchIng.Text == "") { MessageBox.Show("¡ No ha especificado la fecha de ingreso !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); booEstado = false; return(booEstado); } if (TxtFchDoc.Text == "") { MessageBox.Show("¡ No ha especificado la fecha del documento !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); booEstado = false; return(booEstado); } if (Convert.ToInt16(CboTipDoc.SelectedValue) == 0) { MessageBox.Show("¡ No ha especificado el tipo de documento !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); booEstado = false; return(booEstado); } if (TxtNumSer.Text == "") { MessageBox.Show("¡ No ha especificado el numero de serie !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); booEstado = false; return(booEstado); } if (TxtNumDoc.Text == "") { MessageBox.Show("¡ No ha especificado el numero de documento !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); booEstado = false; return(booEstado); } if (Convert.ToInt16(CboProveedor.SelectedValue) == 0) { MessageBox.Show("¡ No ha especificado el nombre del proveedor !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); booEstado = false; return(booEstado); } if (Convert.ToInt16(CboAlmacen.SelectedValue) == 0) { MessageBox.Show("¡ No ha especificado el almacen de destino !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); booEstado = false; return(booEstado); } if (FgItems.Rows.Count != 2) { int intFila; // VERIFICAMOS QUE LOS DATOS DE LAS PRESENTACIONES ESTEN COMPLETAS for (intFila = 2; intFila <= FgItems.Rows.Count - 1; intFila++) { if (funFunciones.NulosC(FgItems.GetData(intFila, 1)) != "") { if (funFunciones.NulosC(FgItems.GetData(intFila, 2)) == "") { MessageBox.Show("¡ No ha especificado la descripcion del item en la fila " + (FgItems.Rows.Count - 2).ToString() + " !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); booEstado = false; return(booEstado); } if (funFunciones.NulosC(FgItems.GetData(intFila, 3)) == "") { MessageBox.Show("¡ No ha especificado la presentacion del item en la fila " + (FgItems.Rows.Count - 2).ToString() + " !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); booEstado = false; return(booEstado); } if (funFunciones.NulosC(FgItems.GetData(intFila, 4)) == "") { MessageBox.Show("¡ No ha especificado la cantidad del item que ingresara en la fila " + (FgItems.Rows.Count - 2).ToString() + " !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); booEstado = false; return(booEstado); } } } } else { MessageBox.Show("¡ No ha especificado ningun item para este ingreso!", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); booEstado = false; return(booEstado); } return(booEstado); }
void AsignarEntidad() { //BE_Movimiento.lst_items; //BE_Movimiento.n_id; BE_Movimiento.n_idemp = STU_SISTEMA.EMPRESAID; BE_Movimiento.n_idtipmov = 2; // 1 = INGRESO ; 2 = SALIDA BE_Movimiento.n_idclipro = Convert.ToInt16(CboProveedor.SelectedValue); BE_Movimiento.d_fchdoc = Convert.ToDateTime(TxtFchDoc.Text); BE_Movimiento.d_fching = Convert.ToDateTime(txtFchIng.Text); BE_Movimiento.n_idtipdoc = Convert.ToInt16(CboTipDoc.SelectedValue); BE_Movimiento.c_numser = TxtNumSer.Text; BE_Movimiento.c_numdoc = TxtNumDoc.Text; BE_Movimiento.n_idalm = Convert.ToInt16(CboAlmacen.SelectedValue); BE_Movimiento.n_anotra = STU_SISTEMA.ANOTRABAJO; BE_Movimiento.n_idmes = STU_SISTEMA.MESTRABAJO; BE_Movimiento.c_obs = TxtObs.Text;; int n_fila = 0; int n_NumeroElementos = 0; if (BE_Movimiento.lst_items != null) { n_NumeroElementos = Convert.ToInt16(BE_Movimiento.lst_items.Count - 1); for (n_fila = 0; n_fila <= n_NumeroElementos; n_fila++) { BE_Movimiento.lst_items.RemoveAt(0); } } n_fila = 0; booAgregando = true; List <BE_ALM_MOVIMIENTOSDET_CONSULTA> LstDetalle = new List <BE_ALM_MOVIMIENTOSDET_CONSULTA>(); if (FgItems.Rows.Count > 2) { for (n_fila = 2; n_fila <= FgItems.Rows.Count - 1; n_fila++) { if (funFunciones.NulosC(FgItems.GetData(n_fila, 1)) != "") { BE_ALM_MOVIMIENTOSDET_CONSULTA BE_Detalle = new BE_ALM_MOVIMIENTOSDET_CONSULTA(); BE_Detalle.n_idmov = 0; BE_Detalle.n_can = Convert.ToDouble(FgItems.GetData(n_fila, 4).ToString()); BE_Detalle.c_tipexides = FgItems.GetData(n_fila, 1).ToString(); BE_Detalle.c_itedes = FgItems.GetData(n_fila, 2).ToString(); BE_Detalle.c_itepredes = FgItems.GetData(n_fila, 3).ToString(); DataTable DtFiltro = new DataTable(); // FILTRAMOS EL ITEM DE LA FILA PARA OBTENER EL ID string strCadenaFiltro = "c_despro = '" + BE_Detalle.c_itedes + "'"; DtFiltro = funDatos.DataTableFiltrar(dtItems, strCadenaFiltro); BE_Detalle.n_idite = Convert.ToInt32(DtFiltro.Rows[0]["n_id"].ToString()); // FILTRAMOS LA PRESENTACION PARA OBTENER SU ID strCadenaFiltro = "c_des = '" + BE_Detalle.c_itepredes + "' AND n_idite = " + BE_Detalle.n_idite + ""; DtFiltro = funDatos.DataTableFiltrar(dtPresentaItem, strCadenaFiltro); BE_Detalle.n_idpre = Convert.ToInt32(DtFiltro.Rows[0]["n_id"].ToString()); // FILTRAMOS EL TIPO DE PRODUCTO PARA OBTENER SU id strCadenaFiltro = "c_des = '" + BE_Detalle.c_tipexides + "'"; DtFiltro = funDatos.DataTableFiltrar(dtTipoExis, strCadenaFiltro); BE_Detalle.n_idtippro = Convert.ToInt32(DtFiltro.Rows[0]["n_id"].ToString()); LstDetalle.Add(BE_Detalle); } } BE_Movimiento.lst_items = LstDetalle; } booAgregando = false; }
void MostrarDatosItems() { int n_row = 0; int n_numanos = 0; double n_valor; DataTable dtResult = new DataTable(); CN_ges_planventas o_plan = new CN_ges_planventas(); dtResult = funDatos.DataTableFiltrar(dtItems, "n_id = " + n_IdItem + ""); if (dtResult.Rows.Count != 0) { TxtCodPro.Text = dtResult.Rows[0]["c_codpro"].ToString(); TxtDes.Text = dtResult.Rows[0]["c_despro"].ToString(); TxtUniMed.Text = dtResult.Rows[0]["c_abrpre"].ToString(); } o_plan.mysConec = mysConec; o_plan.VentasItemxPorAnos(STU_SISTEMA.EMPRESAID, n_IdItem); dtResult = o_plan.dtLista; FgItems.Rows.Count = 2; if (dtResult != null) { if (dtResult.Rows.Count != 0) { funFlex.FlexMostrarDatos(FgItems, arrCabeceraFlex1, dtResult, 2, true); FgItems.SelectionMode = C1.Win.C1FlexGrid.SelectionModeEnum.Row; n_numanos = dtResult.Rows.Count; // CALCULAMOS EL TOTAL double n_totalmes = 0; FgItems.Rows.Count = FgItems.Rows.Count + 1; FgItems.SetData(FgItems.Rows.Count - 1, 1, "TOTAL ==>"); n_totalmes = funFlex.FlexSumarCol(FgItems, 2, 2, FgItems.Rows.Count - 1); FgItems.SetData(FgItems.Rows.Count - 1, 2, n_totalmes.ToString("0.00")); n_totalmes = funFlex.FlexSumarCol(FgItems, 3, 2, FgItems.Rows.Count - 1); FgItems.SetData(FgItems.Rows.Count - 1, 3, n_totalmes.ToString("0.00")); n_totalmes = funFlex.FlexSumarCol(FgItems, 4, 2, FgItems.Rows.Count - 1); FgItems.SetData(FgItems.Rows.Count - 1, 4, n_totalmes.ToString("0.00")); n_totalmes = funFlex.FlexSumarCol(FgItems, 5, 2, FgItems.Rows.Count - 1); FgItems.SetData(FgItems.Rows.Count - 1, 5, n_totalmes.ToString("0.00")); n_totalmes = funFlex.FlexSumarCol(FgItems, 6, 2, FgItems.Rows.Count - 1); FgItems.SetData(FgItems.Rows.Count - 1, 6, n_totalmes.ToString("0.00")); n_totalmes = funFlex.FlexSumarCol(FgItems, 7, 2, FgItems.Rows.Count - 1); FgItems.SetData(FgItems.Rows.Count - 1, 7, n_totalmes.ToString("0.00")); n_totalmes = funFlex.FlexSumarCol(FgItems, 8, 2, FgItems.Rows.Count - 1); FgItems.SetData(FgItems.Rows.Count - 1, 8, n_totalmes.ToString("0.00")); n_totalmes = funFlex.FlexSumarCol(FgItems, 9, 2, FgItems.Rows.Count - 1); FgItems.SetData(FgItems.Rows.Count - 1, 9, n_totalmes.ToString("0.00")); n_totalmes = funFlex.FlexSumarCol(FgItems, 10, 2, FgItems.Rows.Count - 1); FgItems.SetData(FgItems.Rows.Count - 1, 10, n_totalmes.ToString("0.00")); n_totalmes = funFlex.FlexSumarCol(FgItems, 11, 2, FgItems.Rows.Count - 1); FgItems.SetData(FgItems.Rows.Count - 1, 11, n_totalmes.ToString("0.00")); n_totalmes = funFlex.FlexSumarCol(FgItems, 12, 2, FgItems.Rows.Count - 1); FgItems.SetData(FgItems.Rows.Count - 1, 12, n_totalmes.ToString("0.00")); n_totalmes = funFlex.FlexSumarCol(FgItems, 13, 2, FgItems.Rows.Count - 1); FgItems.SetData(FgItems.Rows.Count - 1, 13, n_totalmes.ToString("0.00")); n_totalmes = funFlex.FlexSumarCol(FgItems, 14, 2, FgItems.Rows.Count - 1); FgItems.SetData(FgItems.Rows.Count - 1, 14, n_totalmes.ToString("0.00")); //CALCULAMOS EL PROMEDIO FgItems.Rows.Count = FgItems.Rows.Count + 1; FgItems.SetData(FgItems.Rows.Count - 1, 1, "PROMEDIO ==>"); double n_total = 0; Double n_promedio = 0; n_total = Convert.ToDouble(FgItems.GetData(FgItems.Rows.Count - 2, 2)); n_promedio = (n_total / n_numanos); FgItems.SetData(FgItems.Rows.Count - 1, 2, n_promedio.ToString("0.00")); n_total = Convert.ToDouble(FgItems.GetData(FgItems.Rows.Count - 2, 3)); n_promedio = (n_total / n_numanos); FgItems.SetData(FgItems.Rows.Count - 1, 3, n_promedio.ToString("0.00")); n_total = Convert.ToDouble(FgItems.GetData(FgItems.Rows.Count - 2, 4)); n_promedio = (n_total / n_numanos); FgItems.SetData(FgItems.Rows.Count - 1, 4, n_promedio.ToString("0.00")); n_total = Convert.ToDouble(FgItems.GetData(FgItems.Rows.Count - 2, 5)); n_promedio = (n_total / n_numanos); FgItems.SetData(FgItems.Rows.Count - 1, 5, n_promedio.ToString("0.00")); n_total = Convert.ToDouble(FgItems.GetData(FgItems.Rows.Count - 2, 6)); n_promedio = (n_total / n_numanos); FgItems.SetData(FgItems.Rows.Count - 1, 6, n_promedio.ToString("0.00")); n_total = Convert.ToDouble(FgItems.GetData(FgItems.Rows.Count - 2, 7)); n_promedio = (n_total / n_numanos); FgItems.SetData(FgItems.Rows.Count - 1, 7, n_promedio.ToString("0.00")); n_total = Convert.ToDouble(FgItems.GetData(FgItems.Rows.Count - 2, 8)); n_promedio = (n_total / n_numanos); FgItems.SetData(FgItems.Rows.Count - 1, 8, n_promedio.ToString("0.00")); n_total = Convert.ToDouble(FgItems.GetData(FgItems.Rows.Count - 2, 9)); n_promedio = (n_total / n_numanos); FgItems.SetData(FgItems.Rows.Count - 1, 9, n_promedio.ToString("0.00")); n_total = Convert.ToDouble(FgItems.GetData(FgItems.Rows.Count - 2, 10)); n_promedio = (n_total / n_numanos); FgItems.SetData(FgItems.Rows.Count - 1, 10, n_promedio.ToString("0.00")); n_total = Convert.ToDouble(FgItems.GetData(FgItems.Rows.Count - 2, 11)); n_promedio = (n_total / n_numanos); FgItems.SetData(FgItems.Rows.Count - 1, 11, n_promedio.ToString("0.00")); n_total = Convert.ToDouble(FgItems.GetData(FgItems.Rows.Count - 2, 12)); n_promedio = (n_total / n_numanos); FgItems.SetData(FgItems.Rows.Count - 1, 12, n_promedio.ToString("0.00")); n_total = Convert.ToDouble(FgItems.GetData(FgItems.Rows.Count - 2, 13)); n_promedio = (n_total / n_numanos); FgItems.SetData(FgItems.Rows.Count - 1, 13, n_promedio.ToString("0.00")); n_total = Convert.ToDouble(FgItems.GetData(FgItems.Rows.Count - 2, 14)); n_promedio = (n_total / n_numanos); FgItems.SetData(FgItems.Rows.Count - 1, 14, n_promedio.ToString("0.00")); } } string[] c_datos = new string[12]; int n_fil = 0; int n_ele = 0; string c_dato = ""; n_row = 0; for (n_row = 2; n_row <= FgItems.Rows.Count - 3; n_row++) { n_ele = 0; for (n_fil = 2; n_fil <= FgItems.Cols.Count - 4; n_fil++) { c_datos[n_ele] = Convert.ToDouble(funFunciones.NulosN(FgItems.GetData(n_row, n_fil))).ToString("0.00"); n_ele = n_ele + 1; } c_dato = HallarPromedio(c_datos).ToString("0.00"); FgItems.SetData(n_row, FgItems.Cols.Count - 1, c_dato); } funFlex.Flex_PintarCeldas(FgItems, FgItems.Rows.Count - 2, 1, FgItems.Rows.Count - 1, 14, Color.Black, Color.Coral); funFlex.Flex_PintarCeldas(FgItems, 2, FgItems.Cols.Count - 2, FgItems.Rows.Count - 1, FgItems.Cols.Count - 1, Color.Black, Color.LightCoral); MostrarPlanVenta(); }
bool CamposOK() { bool booEstado = true; if (txtFchIng.Text == "") { MessageBox.Show("¡ No ha especificado la fecha de ingreso !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); txtFchIng.Focus(); booEstado = false; return(booEstado); } if (TxtFchDoc.Text == "") { MessageBox.Show("¡ No ha especificado la fecha del documento !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); TxtFchDoc.Focus(); booEstado = false; return(booEstado); } if (TxtNumSer.Text == "") { MessageBox.Show("¡ No ha especificado el numero de serie !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); TxtNumSer.Focus(); booEstado = false; return(booEstado); } if (TxtNumDoc.Text == "") { MessageBox.Show("¡ No ha especificado el numero de documento !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); TxtNumDoc.Focus(); booEstado = false; return(booEstado); } if (Convert.ToInt32(CboAlmacenOrigen.SelectedValue) == 0) { MessageBox.Show("¡ No ha especificado el almacen de Origen !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); CboAlmacenOrigen.Focus(); booEstado = false; return(booEstado); } if (Convert.ToInt32(CboAlmacenDestino.SelectedValue) == 0) { MessageBox.Show("¡ No ha especificado el almacen de Destino !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); CboAlmacenDestino.Focus(); booEstado = false; return(booEstado); } if (Convert.ToInt32(CboAlmacenDestino.SelectedValue) == Convert.ToInt32(CboAlmacenOrigen.SelectedValue)) { MessageBox.Show("¡ Almacén origen y destino no pueden ser iguales !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); CboAlmacenDestino.Focus(); booEstado = false; return(booEstado); } if (Convert.ToInt32(Convert.ToDateTime(TxtFchDoc.Text).ToString("MM")) != Convert.ToInt32(CboMeses.SelectedValue)) { MessageBox.Show("¡ La fecha del documento de salida no coincide con el mes de trabajo !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); TxtFchDoc.Focus(); booEstado = false; return(booEstado); } if (FgItems.Rows.Count != 2) { int intFila; // VERIFICAMOS QUE LOS DATOS DE LAS PRESENTACIONES ESTEN COMPLETAS for (intFila = 2; intFila <= FgItems.Rows.Count - 1; intFila++) { if (funFunciones.NulosC(FgItems.GetData(intFila, 1)) != "") { if (funFunciones.NulosC(FgItems.GetData(intFila, 2)) == "") { MessageBox.Show("¡ No ha especificado la descripcion del item en la fila " + (FgItems.Row - 1).ToString() + " !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); booEstado = false; return(booEstado); } if (funFunciones.NulosC(FgItems.GetData(intFila, 3)) == "") { MessageBox.Show("¡ No ha especificado la presentacion del item en la fila " + (FgItems.Row - 1).ToString() + " !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); booEstado = false; return(booEstado); } if (N_INGTRAZABALIDAD == 1) { if (funFunciones.NulosC(FgItems.GetData(intFila, 4)) == "") { MessageBox.Show("¡ No ha especificado el numero de lote, en la fila " + (FgItems.Row - 1).ToString() + " !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); booEstado = false; return(booEstado); } } if (funFunciones.NulosC(FgItems.GetData(intFila, 6)) == "") { MessageBox.Show("¡ No ha especificado la cantidad del item que ingresara en la fila " + (FgItems.Row - 1).ToString() + " !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); booEstado = false; return(booEstado); } if (funFunciones.NulosC(FgItems.GetData(intFila, 9)) == "") { MessageBox.Show("¡ No ha especificado la hora de salida del item en la fila " + (FgItems.Row - 1).ToString() + " !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); booEstado = false; return(booEstado); } } } } else { MessageBox.Show("¡ No ha especificado ningun item para este ingreso!", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); booEstado = false; return(booEstado); } return(booEstado); }
void AsignarEntidad() { int n_row = 0; l_Detalle.Clear(); l_Documentos.Clear(); if (n_QueHace == 1) { e_Cabecera.n_id = 0; } if (n_QueHace == 2) { e_Cabecera.n_id = e_Cabecera.n_id; } e_Cabecera.n_idemp = STU_SISTEMA.EMPRESAID; e_Cabecera.n_anotra = STU_SISTEMA.ANOTRABAJO; e_Cabecera.n_idmes = STU_SISTEMA.MESTRABAJO; e_Cabecera.n_idlib = 32; e_Cabecera.c_numreg = LblNumAsi.Text; e_Cabecera.n_idtippro = 0; e_Cabecera.n_idpro = Convert.ToInt32(LblIdPro.Text); e_Cabecera.n_idtipdoc = Convert.ToInt32(CboTipDoc.SelectedValue); e_Cabecera.c_numser = TxtNumSer.Text; e_Cabecera.c_numdoc = TxtNumDoc.Text; e_Cabecera.d_fchdoc = Convert.ToDateTime(TxtFchEmi.Text); e_Cabecera.d_fchreg = Convert.ToDateTime(TxtFchEmi.Text); e_Cabecera.n_idconpag = Convert.ToInt32(CboConPag.SelectedValue); e_Cabecera.d_fchven = Convert.ToDateTime(TxtFchVen.Text); e_Cabecera.n_idmon = Convert.ToInt32(CboMoneda.SelectedValue); e_Cabecera.n_impbru = Convert.ToDouble(TxtImpTot.Text); e_Cabecera.n_impbru2 = 0; e_Cabecera.n_impbru3 = 0; e_Cabecera.n_impinaf = 0; e_Cabecera.n_impigv = Convert.ToDouble(TxtImpuesto.Text);; e_Cabecera.n_impigv2 = 0; e_Cabecera.n_impigv3 = 0; e_Cabecera.n_impisc = 0; e_Cabecera.n_impotr = 0; e_Cabecera.n_imptotcom = Convert.ToDouble(TxtImponible.Text); e_Cabecera.n_tc = Convert.ToDouble(TxtTipCam.Text); e_Cabecera.n_impsal = Convert.ToDouble(TxtImponible.Text); e_Cabecera.n_tasaigv = 0; e_Cabecera.c_glosa = TxtGlo.Text; e_Cabecera.n_estado = 1; e_Cabecera.n_idtipdocref = 0; e_Cabecera.n_iddocref = 0; e_Cabecera.n_idtipope = Convert.ToInt32(CboTipOpe.SelectedValue); if (ChkAfecto.Checked == true) { e_Cabecera.n_tasa4ta = n_por4ta; } else { e_Cabecera.n_tasa4ta = 0; } e_Cabecera.n_imp4ta = Convert.ToDouble(TxtImpuesto.Text); e_Cabecera.n_idtipcom = 1; // LE INDICAMOS QUE EL DOCUMENTO ES SI DOCUMENTO DE REFERENCIA e_Cabecera.n_tipcom = 1; // INDICAMOS QUE ES UNA COMPRANACIONAL // CARGAMOS EL DETALLE DEL DOCUMENTO for (n_row = 2; n_row <= FgItems.Rows.Count - 1; n_row++) { BE_LOG_COMPRASDET e_Det = new BE_LOG_COMPRASDET(); if (funFunciones.NulosC(FgItems.GetData(n_row, 1)).ToString() != "") { e_Det.n_idcom = 0; e_Det.n_iditem = Convert.ToInt32(FgItems.GetData(n_row, 4)); // ID DEL ITEM e_Det.n_idunimed = 0; // ID DE LA UNIDAD DE MEDIDA e_Det.n_canpro = 1; // CANTIDAD DEL PRODUCTO e_Det.n_preunibru = Convert.ToDouble(FgItems.GetData(n_row, 2)); // IMPORTE BRUTO DEL ITEM e_Det.n_idpordsc = 0; // PORCENTAJE DE DESCUENTO DEL ITEM e_Det.n_impdsc = 0; // IMPORTE DEL PORCENTAJE DE DESCUENTO e_Det.n_preuni = Convert.ToDouble(FgItems.GetData(n_row, 2)); // PRECIO UNITARIO DESPUES DEL DESCUENTO e_Det.n_imptot = Convert.ToDouble(FgItems.GetData(n_row, 2)); // IMPORTE TOTAL DEL ITEM DESPUES DEL DESCUENTO l_Detalle.Add(e_Det); } } }
void EjecutarConsulta() { if (OptOpcion3.Checked != true) { if (TxtFchIni.Text == "") { MessageBox.Show("¡ Debe de indicar la fecha de inicio !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); TxtFchIni.Focus(); return; } if (TxtFchFin.Text == "") { MessageBox.Show("¡ Debe de indicar la fecha final !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); TxtFchFin.Focus(); return; } DateTime d_fchini = Convert.ToDateTime(TxtFchIni.Text); DateTime d_fchfin = Convert.ToDateTime(TxtFchFin.Text); if (d_fchini > d_fchfin) { MessageBox.Show("¡ La fecha de inicio no puede ser mayor a la fecha de fin !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); TxtFchIni.Focus(); return; } } string c_cadin = ""; int n_row = 1; string c_cad = ""; for (n_row = 1; n_row <= FgItems.Rows.Count - 1; n_row++) { c_cad = funFunciones.NulosC(FgItems.GetData(n_row, 2)); if (c_cad != "") { if (n_row == 1) { if (c_cad != "") { c_cadin = c_cadin + c_cad; } } else { if (c_cad != "") { c_cadin = c_cadin + ", " + c_cad; } } } } CN_vta_guias objVen = new CN_vta_guias(); objVen.mysConec = mysConec; bool b_Result = false; b_Result = objVen.Consulta10(STU_SISTEMA.EMPRESAID, 2, TxtFchIni.Text, TxtFchFin.Text, c_cadin); if (b_Result == true) { dtLista = objVen.dtLista; if (dtLista.Rows.Count != 0) { Ordenar(); } else { MessageBox.Show("¡ No hay registros en el periodo indicado !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); } } }
void AsignarEntidad() { if (n_QueHace == 1) { e_Proviciones.n_id = 0; } else { e_Proviciones.n_id = Convert.ToInt32(DgLista.Columns["n_id"].CellValue(DgLista.Row).ToString()); } //e_Proviciones.n_id e_Proviciones.n_idlib = Convert.ToInt32(CboLib.SelectedValue); e_Proviciones.n_idsublib = Convert.ToInt32(CboSubLib.SelectedValue); e_Proviciones.n_ano = STU_SISTEMA.ANOTRABAJO; e_Proviciones.n_mes = STU_SISTEMA.MESTRABAJO; e_Proviciones.d_fchreg = DateTime.Now; e_Proviciones.d_fchdoc = Convert.ToDateTime(TxtFchDoc.Text); e_Proviciones.n_idtipdoc = Convert.ToInt32(CboTipDoc.SelectedValue); e_Proviciones.c_numser = TxtNumSer.Text; e_Proviciones.c_numdoc = TxtNumDoc.Text; e_Proviciones.n_idcli = 0; e_Proviciones.c_nomcli = ""; e_Proviciones.n_idmon = Convert.ToInt32(CboMon.SelectedValue); if (e_Proviciones.n_idmon == 115) { e_Proviciones.n_imp = Convert.ToDouble(LblDebSol.Text); } else { e_Proviciones.n_imp = Convert.ToDouble(LblDebDol.Text); } e_Proviciones.c_glosa = TxtGlosa.Text; e_Proviciones.c_numreg = LblNumRegCon.Text; e_Proviciones.n_tc = Convert.ToDouble(LblTc.Text); e_Proviciones.n_ajuste = 0; e_Proviciones.n_idemp = STU_SISTEMA.EMPRESAID; int n_row = 0; string c_dato = ""; l_ProvicionesDet.Clear(); for (n_row = 2; n_row <= FgItems.Rows.Count - 1; n_row++) { if (funFunciones.NulosC(FgItems.GetData(n_row, 1)).ToString() != "") { BE_CON_PROVICIONESDET e_Det = new BE_CON_PROVICIONESDET(); e_Det.n_idpro = 0; c_dato = funFunciones.NulosC(FgItems.GetData(n_row, 1)).ToString(); c_dato = funDatos.DataTableBuscar(dtPlaCue, "c_cuecon", "n_id", c_dato, "C").ToString(); e_Det.n_idcuecon = Convert.ToInt32(c_dato); if (Convert.ToInt32(CboMon.SelectedValue) == 151) { c_dato = funFunciones.NulosN(FgItems.GetData(n_row, 5)).ToString(); if (Convert.ToDouble(funFunciones.NulosN(c_dato)) != 0) { e_Det.n_tipo = 1; e_Det.n_impsol = Convert.ToDouble(funFunciones.NulosN(c_dato)) * Convert.ToDouble(LblTc.Text); e_Det.n_impdol = Convert.ToDouble(funFunciones.NulosN(c_dato)); } else { c_dato = funFunciones.NulosN(FgItems.GetData(n_row, 6)).ToString(); if (Convert.ToDouble(funFunciones.NulosN(c_dato)) != 0) { e_Det.n_tipo = 2; e_Det.n_impsol = Convert.ToDouble(funFunciones.NulosN(c_dato)) * Convert.ToDouble(LblTc.Text); e_Det.n_impdol = Convert.ToDouble(funFunciones.NulosN(c_dato)); } } } else { c_dato = funFunciones.NulosN(FgItems.GetData(n_row, 3)).ToString(); if (Convert.ToDouble(funFunciones.NulosN(c_dato)) != 0) { e_Det.n_tipo = 1; e_Det.n_impdol = Convert.ToDouble(funFunciones.NulosN(c_dato)) / Convert.ToDouble(LblTc.Text); e_Det.n_impsol = Convert.ToDouble(funFunciones.NulosN(c_dato)); } else { c_dato = funFunciones.NulosN(FgItems.GetData(n_row, 4)).ToString(); if (Convert.ToDouble(funFunciones.NulosN(c_dato)) != 0) { e_Det.n_tipo = 2; e_Det.n_impdol = Convert.ToDouble(funFunciones.NulosN(c_dato)) / Convert.ToDouble(LblTc.Text); e_Det.n_impsol = Convert.ToDouble(funFunciones.NulosN(c_dato)); } } } l_ProvicionesDet.Add(e_Det); } } }