Esempio n. 1
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            String idInvoice         = Request["idInvoice"];
            String idInvoiceSupplier = "";

            InvoiceClientManager   invCM = new InvoiceClientManager();
            InvoiceSupplierManager invSM = new InvoiceSupplierManager();
            String paymentMethod         = ddlPaymentsMethods.SelectedItem.ToString();
            //Console.WriteLine(txtIdPaymentMethod.Text.ToString());
            int idPaymentMethod = int.Parse(txtIdPaymentMethod.Text.ToString());
            //Console.WriteLine(idPaymentMethod);
            DateTime paymentDate = DateTime.Parse(txtPaymentDate.Text);

            if (idInvoice.Length < 10)
            {
                if (invCM.verifyInvoiceClient(int.Parse(idInvoice)) == 1)
                {
                    DOM.InvoiceClient invoice = invCM.loadInvoiceClientById(idInvoice);
                    if (paymentMethod == "Transferencia")
                    {
                        paymentMethod = "Transferen.";
                    }
                    invoice.payMethod   = paymentMethod;
                    invoice.idPayMethod = idPaymentMethod;
                    invoice.paymentDate = paymentDate;
                    invoice.condition   = 1;

                    if (invCM.ModifyInvoiceClient(invoice))
                    {
                        //Mensaje de exito
                        Response.Redirect("~/CloseBillSuccess.aspx");
                    }
                }
            }
            else
            {
                idInvoiceSupplier = idInvoice.Replace(" ", String.Empty);

                if (invSM.verifyInvoiceSupplier(idInvoiceSupplier) == 1)
                {
                    DOM.InvoiceSupplier invoice = invSM.loadSupplierById(idInvoiceSupplier);
                    if (paymentMethod == "Transferencia")
                    {
                        paymentMethod = "Transferen.";
                    }
                    invoice.payMethod   = paymentMethod;
                    invoice.idPayMethod = idPaymentMethod;
                    invoice.paymentDate = paymentDate;
                    invoice.condition   = 1;

                    if (invSM.ModifyInvoiceSupplier(invoice))
                    {
                        //Mensaje de exito
                        Response.Redirect("~/CloseBillSuccess.aspx");
                    }
                }
            }
        }
Esempio n. 2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            String idInvoice         = Request["idInvoice"];
            String idInvoiceSupplier = "";

            InvoiceClientManager   invCM = new InvoiceClientManager();
            InvoiceSupplierManager invSM = new InvoiceSupplierManager();
            DateTime paymentDate         = DateTime.Parse(txtPaymentDate.Text);

            if (idInvoice.Length < 10)
            {
                if (invCM.verifyInvoiceClient(int.Parse(idInvoice)) == 1)
                {
                    DOM.InvoiceClient invoice = invCM.loadInvoiceClientById(idInvoice);
                    invoice.paymentDate = paymentDate;

                    if (invCM.ModifyInvoiceClientPostpone(invoice))
                    {
                        //Mensaje de exito
                        Response.Redirect("~/PostponeBillSuccess.aspx");
                    }
                }
            }
            else
            {
                idInvoiceSupplier = idInvoice.Replace(" ", String.Empty);

                if (invSM.verifyInvoiceSupplier(idInvoiceSupplier) == 1)
                {
                    DOM.InvoiceSupplier invoice = invSM.loadSupplierById(idInvoiceSupplier);
                    invoice.paymentDate = paymentDate;
                    if (invSM.ModifyInvoiceSupplierPostpone(invoice))
                    {
                        //Mensaje de exito
                        Response.Redirect("~/PostponeBillSuccess.aspx");
                    }
                }
            }
        }