Пример #1
0
        private void busca_operacion()
        {
            Infraccion minfraccion = new InfraccionBC().GetinfraccionbyIdSolicitud(Convert.ToInt32(id_solicitud));

            if (minfraccion != null)
            {
                this.lbl_operacion.Visible = true;
                this.lbl_numero.Visible    = true;
                this.ib_gasto.Visible      = true;
                this.lbl_operacion.Text    = "Operación de Multas Numero:";
                this.lbl_numero.Text       = Convert.ToString(minfraccion.Operacion.Id_solicitud);
                this.ib_gasto.Attributes.Add("OnClick", "javascript:window.showModalDialog('../operacion/gastooperacion.aspx?id_solicitud=" + FuncionGlobal.FuctionEncriptar(lbl_numero.Text.Trim()) + "','#1','dialogHeight: 350px; dialogWidth: 900px;dialogTop: 190px; dialogLeft: 220px; edge: Raised; center: Yes;help: No; resizable: No; status: No;');");
                getInfraccion(this.lbl_numero.Text);

                //**datos vehiculo

                if (minfraccion.Patente != null)
                {
                    this.dl_cliente.SelectedValue         = minfraccion.Operacion.Cliente.Id_cliente.ToString();
                    this.txt_patente.Text                 = minfraccion.Patente.Trim();
                    this.dl_sucursal_origen.SelectedValue = minfraccion.Secursal_origen.ToString();
                    this.txt_dv_patente.Text              = FuncionGlobal.digitoVerificadorPatente(txt_patente.Text);
                }

                //**adquiriente

                //if (minfraccion.Rut != 0)
                //{
                //    busca_persona(minfraccion.Rut);
                //    this.txt_rut.Text = minfraccion.Rut.ToString();
                //}
                //if (minfraccion.Rut != null)
                if (minfraccion.Rut != 0)
                {
                    this.agpInfractor.Mostrar_Form(minfraccion.Rut);
                }
                minfraccion = null;
            }
        }
Пример #2
0
        private void add_operacion()
        {
            double rut = 0;

            GridViewRow row;

            if (this.agpInfractor.Guardar_Form())
            {
                if (this.agpInfractor.InfoPersona != null)
                {
                    rut = this.agpInfractor.InfoPersona.Rut;
                }
            }



            //if (this.txt_rut.Text == "") { rut = 0; } else {
            //    rut = Convert.ToDouble(this.txt_rut.Text);
            //    string persona = new PersonaBC().add_persona(Convert.ToDouble(this.txt_rut.Text),
            //                                                     this.txt_dv.Text,
            //                                                     Convert.ToInt16(this.dl_comuna.SelectedValue),
            //                                                        "",
            //                                                        this.txt_nombre.Text,
            //                                                        this.txt_paterno.Text,
            //                                                        this.txt_materno.Text,
            //                                                        "0",
            //                                                        "0",
            //                                                        "",
            //                                                        "",
            //                                                        "0",
            //                                                        this.txt_telefono.Text,
            //                                                        "",
            //                                                        "",
            //                                                        this.txt_direccion.Text,
            //                                                        this.txt_numero.Text,
            //                                                        this.txt_depto.Text,
            //                                                        "0");
            //}



            Int32 add = new OperacionBC().add_operacion(Convert.ToInt32(this.lbl_numero.Text), Convert.ToInt16(this.dl_cliente.SelectedValue), this.tipo_operacion, (string)(Session["usrname"]), 0, "", Convert.ToInt32(this.dl_sucursal_origen.SelectedValue), 0);

            string addI_MU = new InfraccionBC().add_infraccion(add,
                                                               this.txt_patente.Text,
                                                               Convert.ToInt32(rut),

                                                               this.dl_sucursal_origen.SelectedValue
                                                               );



            if (add != 0)
            {
                string add_MU = "";
                Int32  monto;
                for (int i = 0; i < gr_dato.Rows.Count; i++)
                {
                    row = gr_dato.Rows[i];

                    DropDownList dl = (DropDownList)gr_dato.Rows[i].FindControl("dl_tipo_infraccion");
                    TextBox      txt_observacion = (TextBox)gr_dato.Rows[i].FindControl("txt_observacion");
                    TextBox      txt_monto       = (TextBox)gr_dato.Rows[i].FindControl("txt_monto");
                    TextBox      txt_fecha       = (TextBox)gr_dato.Rows[i].FindControl("txt_fecha");

                    string codigo      = dl.SelectedValue.ToString();
                    string observacion = txt_observacion.Text.ToString();
                    string fecha       = txt_fecha.Text.ToString();
                    if (txt_monto.Text != "")
                    {
                        monto = Convert.ToInt32(txt_monto.Text.ToString());
                    }
                    else
                    {
                        monto = 0;
                    }

                    if (codigo != "0")
                    {
                        add_MU = new GastosInfraccionBC().add_gastosInfraccion(add,
                                                                               codigo,
                                                                               observacion,
                                                                               monto,
                                                                               fecha
                                                                               );
                    }
                }

                if (add_MU == "")
                {
                    string add_or = new EstadooperacionBC().add_estado_orden(Convert.ToInt32(add), 1, "MU", "", (string)(Session["usrname"]));
                }
            }

            this.lbl_operacion.Visible = true;
            this.lbl_numero.Visible    = true;

            this.lbl_operacion.Text = "Operación de Infraccion Numero:";
            this.lbl_numero.Text    = Convert.ToString(add);

            this.ib_gasto.Visible = true;
            this.ib_gasto.Attributes.Add("OnClick", "javascript:window.showModalDialog('../operacion/gastooperacion.aspx?id_solicitud=" + FuncionGlobal.FuctionEncriptar(lbl_numero.Text.Trim()) + "','#1','dialogHeight: 350px; dialogWidth: 900px;dialogTop: 190px; dialogLeft: 220px; edge: Raised; center: Yes;help: No; resizable: No; status: No;');");

            this.bt_caratula.Visible = true;
            //carga_rpt(add);
            getInfraccion(this.lbl_numero.Text);
        }