Exemple #1
0
        public void getInfraccion(string solicitud)
        {
            DataTable dt = new DataTable();

            dt.Columns.Add(new DataColumn("tipoInfraccion"));
            dt.Columns.Add(new DataColumn("descripcion"));
            dt.Columns.Add(new DataColumn("observacion"));
            dt.Columns.Add(new DataColumn("monto"));
            dt.Columns.Add(new DataColumn("fecha"));



            List <GastosInfraccion> lInfraccion = new GastosInfraccionBC().Getinfraccion(Convert.ToInt32(solicitud));

            if (lInfraccion.Count > 0)
            {
                this.bt_guardar.Visible = true;
            }

            foreach (GastosInfraccion mInfraccion in lInfraccion)
            {
                DataRow dr = dt.NewRow();

                dr["tipoInfraccion"] = mInfraccion.Codigo;
                dr["descripcion"]    = mInfraccion.Descripcion;
                dr["observacion"]    = mInfraccion.Observacion;
                dr["monto"]          = mInfraccion.Monto;
                dr["fecha"]          = mInfraccion.Fecha;
                dt.Rows.Add(dr);
            }


            DataRow draux = dt.NewRow();

            draux["tipoInfraccion"] = "0";
            draux["descripcion"]    = "";
            draux["observacion"]    = "";
            draux["monto"]          = "";
            draux["fecha"]          = "";


            dt.Rows.Add(draux);

            this.gr_dato.DataSource = dt;
            this.gr_dato.DataBind();
        }
Exemple #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);
        }