コード例 #1
0
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            //Jbaez:subir documento
            if (this.filesubir.PostedFile.ContentLength > 0)
            {
                string strRutCliente = null;
                string path          = base.Server.MapPath(@"~\DIGITALIZADOS");

                string nomArchivo = this.filesubir.PostedFile.FileName;// +Path.GetExtension(this.filesubir.PostedFile.FileName);
                if (nomArchivo.Contains("\\"))
                {
                    nomArchivo = nomArchivo.Substring(nomArchivo.LastIndexOf("\\")).Replace("\\", string.Empty);
                }
                if (nomArchivo.Contains("/"))
                {
                    nomArchivo = nomArchivo.Substring(nomArchivo.LastIndexOf("/")).Replace("/", string.Empty);
                }


                string str4 = UTIL.SubirArchivo(this.filesubir, path, nomArchivo);
                if (!(str4 == "OK"))
                {
                    this.Page.RegisterClientScriptBlock("Mensaje", "<script>alert('" + str4.ToString() + "');</script>");
                }
                else if (!string.IsNullOrEmpty(nomArchivo))
                {
                    DataTable tabla = Consulta.InformeBienesRaicesDeudor(null, txtRut.Text);
                    strRutCliente = tabla != null && tabla.Rows.Count > 0 ? tabla.Rows[0]["RutCliente"].ToString() : "ALCSA";

                    Transaccion.InsertaDocBienesDigitalizado(txtRut.Text, nomArchivo, this.txtPatente.Text, strRutCliente, "64");
                    this.Page.RegisterClientScriptBlock("Mensaje", "<script>alert('Documento digitalizado exitosamente');</script>");
                    this.filesubir.Focus();
                }
            }

            Transaccion.InsertaBienMueble(
                this.tipovehiculo.SelectedValue,
                this.marca.SelectedValue,
                this.modelo.SelectedValue,
                this.txtChassis.Text,
                this.color.SelectedValue,
                this.txtRut.Text.Replace(".", ""),
                this.txtMotor.Text,
                this.txtPatente.Text,
                this.txtAnioFabricacion.Text,
                this.limitaciones.SelectedValue,
                this.estado.SelectedValue);

            this.Page.RegisterClientScriptBlock("Mensaje", "<script>alert('Datos guardados correctamente');</script>");
            this.Deshabilitar();
            this.Cancela();
        }
コード例 #2
0
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            try
            {
                string domicilioSeleccionado = this.domicilio.SelectedValue;

                if ("No se ubican nuevos bienes".Equals(domicilioSeleccionado))
                {
                    domicilioSeleccionado = "0";
                }

                if (Consulta.BuscaBienRaizDuplicado(domicilioSeleccionado, this.txtRut.Text) == null)
                {
                    //Jbaez:subir documento

                    if (this.filesubir.PostedFile.ContentLength > 0)
                    {
                        string nomArchivo    = "";
                        string strRutCliente = null;
                        string path          = base.Server.MapPath(@"~\DIGITALIZADOS");
                        nomArchivo = this.filesubir.PostedFile.FileName;// +Path.GetExtension(this.filesubir.PostedFile.FileName);
                        string str4 = UTIL.SubirArchivo(this.filesubir, path, nomArchivo);
                        if (!(str4 == "OK"))
                        {
                            this.Page.RegisterClientScriptBlock("Mensaje", "<script>alert('" + str4.ToString() + "');</script>");
                        }
                        else if (!string.IsNullOrEmpty(nomArchivo))
                        {
                            DataTable tabla = new DataTable();

                            tabla = Consulta.InformeBienesRaicesDeudor(null, txtRut.Text);
                            if (tabla.Rows.Count > 0)
                            {
                                strRutCliente = tabla.Rows[0]["RutCliente"].ToString();
                            }
                            else
                            {
                                strRutCliente = "ALCSA";
                            }
                            Transaccion.InsertaDocBienesDigitalizado(txtRut.Text, nomArchivo, txtFojaInsc.Text, strRutCliente, "64");
                            this.Page.RegisterClientScriptBlock("Mensaje", "<script>alert('Documento digitalizado exitosamente');</script>");

                            this.filesubir.Focus();
                        }
                    }

                    if (!"0".Equals(domicilioSeleccionado))
                    {
                        Transaccion.InsertaBienRaiz(this.txtRut.Text.Replace(".", ""), this.txtFojaInsc.Text, this.txtNroInsc.Text, this.txtAnioInsc.Text, this.txtFoja1hip.Text, this.txtNro1hip.Text, this.txtanio1hip.Text, this.txtFoj2hip.Text, this.txtNro2hip.Text, this.txtAnio2hip.Text, this.txtfojaproh1.Text, this.txtNroProh1.Text, this.txtAnioProh1.Text, this.txtFojaProh2.Text, this.txtNroProh2.Text, this.txtAnioProh2.Text, this.regioncbr.SelectedValue, this.comunacbr.SelectedValue, this.conservador.SelectedValue, this.regionnotaria.SelectedValue, this.comunanotaria.SelectedValue, this.notaria.SelectedValue, this.txtRolAvaluo.Text, this.txtFechaEscritura.Text, this.vigencia.SelectedValue, this.fuente.SelectedValue, this.Limitaciones.SelectedValue, this.domicilio.SelectedValue, this.tipofojainsc.SelectedValue, this.tipofojahip1.SelectedValue, this.tipofojahip2.SelectedValue, this.tipofojaproh1.SelectedValue, this.tipofojaproh2.SelectedValue);
                    }

                    Transaccion.ActualizarDeudorDicomBienRaiz(
                        this.txtRut.Text.Replace(".", ""),
                        Cbx_SinBienes.Checked ? "1" : "0",
                        ALCSA.FWK.Web.Control.ExtraerValorComoDateTime(txt_FechaActual).ToString("yyyyMMdd"));

                    this.Page.RegisterClientScriptBlock("Mensaje", "<script>alert('Datos guardados correctamente');</script>");
                    this.Deshabilitar();
                    this.Cancela();
                    this.CargaRegiComunaDefecto();
                }
                else
                {
                    this.Page.RegisterClientScriptBlock("Mensaje", "<script>alert('Bien Raiz ya se encuentra registrado');</script>");
                    this.txtFojaInsc.Focus();
                }
            }
            catch (Exception)
            {
                this.Page.RegisterClientScriptBlock("Mensaje", "<script>alert('Revise bien la informaci\x00f3n e intentelo de nuevo');</script>");
            }
        }