Example #1
0
        protected Boolean agregarDatosPago()
        {
            Boolean    pagosValidados = true;
            BoxesPagos boxesPagos     = new BoxesPagos();

            var textboxValues = new List <string>();

            if (Request.Form.HasKeys() && listadoPagos.Count > 0)
            {
                string key      = string.Empty;
                string contador = (listadoPagos.Count - 1).ToString();

                key = Request.Form.AllKeys.Where(i => i.Contains((contador + "_Pag_Num"))).FirstOrDefault();
                listadoPagos[(listadoPagos.Count - 1)].numPag = Request.Form[key];

                key = Request.Form.AllKeys.Where(i => i.Contains((contador + "_Pag_For"))).FirstOrDefault();
                listadoPagos[(listadoPagos.Count - 1)].formPag = Request.Form[key];

                key = Request.Form.AllKeys.Where(i => i.Contains((contador + "_Pag_Fol"))).FirstOrDefault();
                listadoPagos[(listadoPagos.Count - 1)].folPag = Request.Form[key];

                key = Request.Form.AllKeys.Where(i => i.Contains((contador + "_Pag_Imp"))).FirstOrDefault();
                listadoPagos[(listadoPagos.Count - 1)].impPag = Request.Form[key];


                if (listadoPagos[(listadoPagos.Count - 1)].formPag == "" || listadoPagos[(listadoPagos.Count - 1)].folPag == "" || listadoPagos[(listadoPagos.Count - 1)].impPag == "" || listadoPagos[(listadoPagos.Count - 1)].formPag == "" || listadoPagos[(listadoPagos.Count - 1)].folPag == "" || listadoPagos[(listadoPagos.Count - 1)].impPag == "")
                {
                    pagosValidados = false;
                }
            }
            return(pagosValidados);
        }
Example #2
0
        public BoxPago crearBoxesPag(BoxesPagos boxesPag, string numID)
        {
            string  cssBoxArt  = "form-control";
            string  cssBoxArt2 = "form-control class";
            BoxPago boxPag     = new BoxPago();

            var boxNum = new TextBox();

            boxNum.ReadOnly  = true;
            boxNum.ID        = numID + "_Pag_Num";
            boxNum.CssClass  = cssBoxArt;
            boxNum.Text      = boxesPag.numPag;
            boxPag.boxNumPag = boxNum;


            listaCuentas = repo.obtCuentas();

            var listForm = new DropDownList();

            listForm.ID       = numID + "_Pag_For";
            listForm.CssClass = cssBoxArt2;
            listaCuentas.ForEach(x =>
            {
                ListItem item = new ListItem();
                item.Value    = x.TENDER_ID.ToString();
                item.Text     = x.TENDER_NAME;
                listForm.Items.Add(item);
            });
            listForm.SelectedValue = boxesPag.formPag;
            listForm.Enabled       = false;
            boxPag.boxFormPag      = listForm;

            /*
             * var boxForm = new TextBox();
             * boxForm.ReadOnly = true;
             * boxForm.ID = numID + "_Pag_For";
             * boxForm.CssClass = cssBoxArt;
             * boxForm.Text = boxesPag.formPag;
             * boxPag.boxFormPag = boxForm;
             */

            var boxFol = new TextBox();

            boxFol.ReadOnly  = true;
            boxFol.ID        = numID + "_Pag_Fol";
            boxFol.CssClass  = cssBoxArt;
            boxFol.Text      = boxesPag.folPag;
            boxPag.boxFolPag = boxFol;

            var boxImp = new TextBox();

            boxImp.ReadOnly  = true;
            boxImp.ID        = numID + "_Pag_Imp";
            boxImp.CssClass  = cssBoxArt;
            boxImp.Text      = boxesPag.impPag;
            boxPag.boxImpPag = boxImp;

            return(boxPag);
        }
Example #3
0
        private string guardarRCT(int docNum, BoxesPagos boxPag)
        {
            Repositorio repo      = new Repositorio();
            RCT         objRct    = new RCT();
            int         conDocNum = repo.obtContadorFormaPagoRct(boxPag.formPag);

            objRct.DocNum1    = docNum;
            objRct.DoCNum     = conDocNum.ToString();
            objRct.LineNum    = "0";
            objRct.DocEntry   = boxPag.folPag;
            objRct.SumApplied = boxPag.impPag;
            objRct.InvType    = "13";

            string mensaje = repo.guardarRct(objRct);

            Response.Write(mensaje);
            return(mensaje);
        }
Example #4
0
        private string guardarVpm(int docNum, BoxesPagos boxPago)
        {
            Repositorio repo      = new Repositorio();
            VPM         objVpm    = new VPM();
            int         conDocNum = repo.obtContadorFormaPagoVpm(boxPago.formPag);


            objVpm.DocNum1    = docNum;
            objVpm.DoCNum     = boxPago.formPag;
            objVpm.LineNum    = "0";
            objVpm.DocEntry   = boxPago.folPag;
            objVpm.SumApplied = boxPago.impPag;
            objVpm.InvType    = "13";

            string mensaje = repo.guardarVpm(objVpm);

            Response.Write(mensaje);
            return(mensaje);
        }
Example #5
0
        //Seccion Pagos
        protected void agregarPagos(object sender, EventArgs e)
        {
            ButtonGuardar.Visible = true;

            if (!validarGeneral())
            {
                mostrarBoxesArticulos();
                mostrarBoxesPagos();
                return;
            }

            if (!validarArts())
            {
                mostrarBoxesArticulos();
                mostrarBoxesPagos();
                return;
            }

            ButtonArticulos.Visible = false;

            mostrarBoxesArticulos();
            generalesLectura();

            contPagos = Int32.Parse(ViewState["conteoPag"].ToString());

            contPagos = contPagos + 1;


            if (listadoPagos.Count > 0)
            {
                if (agregarDatosPago())
                {
                    mostrarBoxesPagos();

                    boxesIniPag = utils.crearBoxesIniPag(listadoPagos.Count.ToString(), contPagos.ToString());
                    BoxesPagos boxesPagos = new BoxesPagos();
                    numPago.Controls.Add(boxesIniPag.boxNumPag);
                    formPago.Controls.Add(boxesIniPag.boxFormPag);
                    folPago.Controls.Add(boxesIniPag.boxFolPag);
                    impPago.Controls.Add(boxesIniPag.boxImpPag);
                    listadoPagos.Add(boxesPagos);
                    ViewState["conteoPag"]    = contPagos.ToString();
                    ViewState["listadoPagos"] = listadoPagos;
                }
                else
                {
                    mostrarBoxesPagos();
                    validarPagos();
                }
            }
            else
            {
                BoxesPagos boxesPagos = new BoxesPagos();
                boxesIniPag = utils.crearBoxesIniPag("0", contPagos.ToString());
                numPago.Controls.Add(boxesIniPag.boxNumPag);
                formPago.Controls.Add(boxesIniPag.boxFormPag);
                folPago.Controls.Add(boxesIniPag.boxFolPag);
                impPago.Controls.Add(boxesIniPag.boxImpPag);

                listadoPagos.Add(boxesPagos);
                ViewState["listadoPagos"] = listadoPagos;
                ViewState["conteoPag"]    = contPagos.ToString();
            }
        }