protected void Procesar_R(object sender, EventArgs e) { BL_SOLPED obj = new BL_SOLPED(); DataTable dtResultado = new DataTable(); dtResultado = obj.uspSEL_RESPONSABLE_PROCESOS(Session["IDE_USUARIO"].ToString(), "RESPONSABLE ANDAMIOS", BL_Session.ID_EMPRESA.ToString()); if (dtResultado.Rows.Count > 0) { LinkButton LinkButtonR = ((LinkButton)sender); GridViewRow grdrow = (GridViewRow)((LinkButton)sender).NamingContainer; int IDE_ANDAMIOS = (int)GridView1.DataKeys[grdrow.RowIndex].Values["IDE_ANDAMIOS"]; lblCodigo.Text = GridView1.DataKeys[grdrow.RowIndex].Values["IDE_ANDAMIOS"].ToString(); lblrpta.Text = LinkButtonR.Text; ModalRegistro.Show(); btnGrabar.Visible = true;// para rechazo txtrechazo.Visible = true; lblMsg.Text = "Comentarios de rechazo"; // ocultar btnPrioridad.Visible = false; ddlPrioridad.Visible = false; } else { string cleanMessage = "No tiene permisos de atención"; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); } }
protected void Listar() { lblRequ_Numero.Text = Request.QueryString["Requ_Numero"].ToString(); lblReqd_CodLinea.Text = Request.QueryString["Reqd_CodLinea"].ToString(); lblReqs_Correlativo.Text = Request.QueryString["Reqs_Correlativo"].ToString(); BL_SOLPED obj = new BL_SOLPED(); DataTable dtResultado = new DataTable(); dtResultado = obj.uspSEL_RESPONSABLE_PROCESOS(Session["IDE_USUARIO"].ToString(), "RESPONSABLE ALQUILER SOLPED", BL_Session.ID_EMPRESA.ToString()); if (dtResultado.Rows.Count > 0) { BL_TBL_RequerimientoSubDetalle Xobj = new BL_TBL_RequerimientoSubDetalle(); DataTable dt = new DataTable(); dt = Xobj.LISTAR_GRUPO_LEGAJOFILE(lblRequ_Numero.Text, lblReqd_CodLinea.Text, lblReqs_Correlativo.Text, 1); dt.Rows.Count.ToString(); if (dt.Rows.Count > 0) { GridReq.DataSource = dt; GridReq.DataBind(); } else { GridReq.DataSource = dt; GridReq.DataBind(); string cleanMessage = "Falta adjuntar documentación de legajos"; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); } } else { string cleanMessage = "No tiene permisos para realizar esta operación"; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); } }
protected void botones() { BL_SOLPED obj = new BL_SOLPED(); DataTable dtResultado = new DataTable(); dtResultado = obj.uspSEL_RESPONSABLE_PROCESOS(Session["IDE_USUARIO"].ToString(), "RESPONSABLE ALMACEN", ddlEmpresa.SelectedValue.ToString()); if (dtResultado.Rows.Count > 0) { btnBandeja.Visible = true; btnSolicitar.Visible = true; } else { dtResultado = obj.uspSEL_RESPONSABLE_PROCESOS(Session["IDE_USUARIO"].ToString(), "RESPONSABLE ALMACEN (SERVICIOS Y TRANSPORTE)", ddlEmpresa.SelectedValue.ToString()); if (dtResultado.Rows.Count > 0) { btnBandeja.Visible = true; btnSolicitar.Visible = true; } else { btnBandeja.Visible = false; btnSolicitar.Visible = false; } } }
//protected void Button1_Click(object sender, EventArgs e) //{ // if (txtSolped.Text.Length < 10) // { // txtSolped.Text = txtSolped.Text + Button1.Text; // ModalRegistro.Show(); // } // else // { // ModalRegistro.Show(); // } //} //protected void Button2_Click(object sender, EventArgs e) //{ // if (txtSolped.Text.Length < 10) // { // txtSolped.Text = txtSolped.Text + Button2.Text; // ModalRegistro.Show(); // } // else // { // ModalRegistro.Show(); // } //} //protected void Button3_Click(object sender, EventArgs e) //{ // if (txtSolped.Text.Length < 10) // { // txtSolped.Text = txtSolped.Text + Button3.Text; // ModalRegistro.Show(); // } // else // { // ModalRegistro.Show(); // } //} //protected void Button4_Click(object sender, EventArgs e) //{ // if (txtSolped.Text.Length < 10) // { // txtSolped.Text = txtSolped.Text + Button4.Text; // ModalRegistro.Show(); // } // else // { // ModalRegistro.Show(); // } //} //protected void Button5_Click(object sender, EventArgs e) //{ // if (txtSolped.Text.Length < 10) // { // txtSolped.Text = txtSolped.Text + Button5.Text; // ModalRegistro.Show(); // } // else // { // ModalRegistro.Show(); // } //} //protected void Button6_Click(object sender, EventArgs e) //{ // if (txtSolped.Text.Length < 10) // { // txtSolped.Text = txtSolped.Text + Button6.Text; // ModalRegistro.Show(); // } // else // { // ModalRegistro.Show(); // } //} //protected void Button7_Click(object sender, EventArgs e) //{ // if (txtSolped.Text.Length < 10) // { // txtSolped.Text = txtSolped.Text + Button7.Text; // ModalRegistro.Show(); // } // else // { // ModalRegistro.Show(); // } //} //protected void Button8_Click(object sender, EventArgs e) //{ // if (txtSolped.Text.Length < 10) // { // txtSolped.Text = txtSolped.Text + Button8.Text; // ModalRegistro.Show(); // } // else // { // ModalRegistro.Show(); // } //} //protected void Button9_Click(object sender, EventArgs e) //{ // if (txtSolped.Text.Length < 10) // { // txtSolped.Text = txtSolped.Text + Button9.Text; // ModalRegistro.Show(); // } // else // { // ModalRegistro.Show(); // } //} //protected void Button0_Click(object sender, EventArgs e) //{ // if (txtSolped.Text.Length < 10) // { // txtSolped.Text = txtSolped.Text + Button0.Text; // ModalRegistro.Show(); // } // else // { // ModalRegistro.Show(); // } //} protected void btnGrabar_Click(object sender, EventArgs e) { BL_SOLPED obj = new BL_SOLPED(); DataTable dt = new DataTable(); if (lblrpta.Text == "R") { if (txtrechazo.Text != string.Empty) { dt = obj.uspUPD_SOLPED_PROCESAR(Convert.ToInt32(lblCodigo.Text), lblrpta.Text, txtrechazo.Text.Trim(), Session["IDE_USUARIO"].ToString(), "", rdoTipo.SelectedValue.ToString()); BL_SOLPED objCorreo = new BL_SOLPED(); objCorreo.SP_ENVIARCORREO_SOLPED_RPTA(Convert.ToInt32(lblCodigo.Text)); string cleanMessage = "Registro procesado"; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); limpiar(); Listar("", "", "", ""); } else { string cleanMessage = "Ingresar sustento"; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); } } }
protected void ControlProceso() { BL_SOLPED obj = new BL_SOLPED(); DataTable dtResultado = new DataTable(); dtResultado = obj.uspSEL_RESPONSABLE_PROCESOS(Session["IDE_USUARIO"].ToString(), "RESPONSABLE ALMACEN", ddlEmpresa.SelectedValue.ToString()); if (dtResultado.Rows.Count > 0) { ddlcentro.DataSource = dtResultado; ddlcentro.DataTextField = "CENTRO"; ddlcentro.DataValueField = "CENTRO"; ddlcentro.DataBind(); ddlcentro.Items.Insert(0, new ListItem("--- TODOS ---", "")); hfPerfil.Value = dtResultado.Rows[0]["tipo"].ToString(); } else { dtResultado = obj.uspSEL_RESPONSABLE_PROCESOS(Session["IDE_USUARIO"].ToString(), "RESPONSABLE ALMACEN (SERVICIOS Y TRANSPORTE)", ddlEmpresa.SelectedValue.ToString()); if (dtResultado.Rows.Count > 0) { ddlcentro.DataSource = dtResultado; ddlcentro.DataTextField = "CENTRO"; ddlcentro.DataValueField = "CENTRO"; ddlcentro.DataBind(); ddlcentro.Items.Insert(0, new ListItem("--- TODOS ---", "")); hfPerfil.Value = dtResultado.Rows[0]["tipo"].ToString(); } } }
protected void botones() { BL_SOLPED obj = new BL_SOLPED(); DataTable dtResultado = new DataTable(); dtResultado = obj.uspSEL_RESPONSABLE_PROCESOS(Session["IDE_USUARIO"].ToString(), "RESPONSABLE ANDAMIOS", BL_Session.ID_EMPRESA.ToString()); if (dtResultado.Rows.Count > 0) { btnBandeja.Visible = true; btnSolicitar.Visible = true; } else { DataTable dt = new DataTable(); dt = obj.uspSEL_RESPONSABLE_PROCESOS(Session["IDE_USUARIO"].ToString(), "RESPONSABLE ANDAMIOS SUPERVISOR", BL_Session.ID_EMPRESA.ToString()); if (dt.Rows.Count > 0) { btnBandeja.Visible = true; btnSolicitar.Visible = true; } else { btnBandeja.Visible = false; btnSolicitar.Visible = false; } } }
protected void Procesar_A(object sender, EventArgs e) { BL_SOLPED objX = new BL_SOLPED(); DataTable dtResultado = new DataTable(); dtResultado = objX.uspSEL_RESPONSABLE_PROCESOS(Session["IDE_USUARIO"].ToString(), "RESPONSABLE ANDAMIOS", BL_Session.ID_EMPRESA.ToString()); if (dtResultado.Rows.Count > 0) { LinkButton LinkButtonA = ((LinkButton)sender); GridViewRow grdrow = (GridViewRow)((LinkButton)sender).NamingContainer; string IDE_ANDAMIOS = GridView1.DataKeys[grdrow.RowIndex].Values["IDE_ANDAMIOS"].ToString(); string CECOS_GESTOR = GridView1.DataKeys[grdrow.RowIndex].Values["CECOS_GESTOR"].ToString(); //string z= pk + " - " + rb.SelectedValue; BL_SOLPED obj = new BL_SOLPED(); DataTable dt = new DataTable(); ScriptManager.RegisterStartupScript(this, typeof(Page), "myScript", "popupAndamios('" + CECOS_GESTOR + "','" + IDE_ANDAMIOS + "'," + 500 + "," + 400 + ");", true); } else { string cleanMessage = "No tiene permisos de atención"; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); } }
protected void btnDescargar_Click(object sender, ImageClickEventArgs e) { TextBox txtFecSol_F = (TextBox)GridView1.HeaderRow.FindControl("txtFecSol_F"); TextBox txtNOM_CREADO_F = (TextBox)GridView1.HeaderRow.FindControl("txtNOM_CREADO_F"); TextBox txtNOM_SOLICITA_F = (TextBox)GridView1.HeaderRow.FindControl("txtNOM_SOLICITA_F"); TextBox txtTICKET_F = (TextBox)GridView1.HeaderRow.FindControl("txtTICKET_F"); string estado = string.Empty; if (ddlEstados.SelectedIndex == 0) { estado = string.Empty; } else { estado = ddlEstados.SelectedValue.ToString(); } string centro = string.Empty; if (ddlcentro.SelectedIndex == 0) { centro = string.Empty; } else { centro = ddlcentro.SelectedValue.ToString(); } string IDE_EMPRESA = string.Empty; //if (ddlEmpresa.SelectedIndex == 0) //{ // IDE_EMPRESA = string.Empty; //} //else //{ // IDE_EMPRESA = ddlEmpresa.SelectedValue.ToString(); //} IDE_EMPRESA = ddlEmpresa.SelectedValue.ToString(); BL_SOLPED obj = new BL_SOLPED(); DataTable dtResultado = new DataTable(); dtResultado = obj.uspSEL_SOLPED_BANDEJA(Session["IDE_USUARIO"].ToString(), estado, ddlanio.SelectedValue.ToString(), txtFecSol_F.Text.Trim(), txtNOM_CREADO_F.Text.Trim(), txtNOM_SOLICITA_F.Text.Trim(), txtTICKET_F.Text.Trim(), centro, hfPerfil.Value, IDE_EMPRESA); if (dtResultado.Rows.Count > 0) { gvExcel.Visible = true; gvExcel.DataSource = dtResultado; gvExcel.DataBind(); GridViewExportUtil.Export("SOLPED_" + DateTime.Now + ".xls", gvExcel); return; } }
protected void Permisos() { BL_SOLPED obj = new BL_SOLPED(); DataTable dtResultado = new DataTable(); dtResultado = obj.uspSEL_RESPONSABLE_PROCESOS(Session["IDE_USUARIO"].ToString(), "RESPONSABLE ALQUILER", BL_Session.ID_EMPRESA.ToString()); if (dtResultado.Rows.Count < 1) { Response.Redirect("~/CAREMENOR/EquiposMayoresAlquilerView.aspx"); } }
//static DataTable GetTableEstados() //{ // // Here we create a DataTable with four columns. // DataTable table = new DataTable(); // table.Columns.Add("IDE", typeof(string)); // table.Columns.Add("DESCRIPCION", typeof(string)); // table.Rows.Add("P", "P"); // table.Rows.Add("E", "E"); // table.Rows.Add("T", "T"); // table.Rows.Add("R", "R"); // return table; //} protected void Procesar(object sender, ImageClickEventArgs e) { ImageButton btnProcesar = ((ImageButton)sender); GridViewRow row = btnProcesar.NamingContainer as GridViewRow; string IDE_ANDAMIOS = GridView1.DataKeys[row.RowIndex].Values[0].ToString(); string CECOS_GESTOR = GridView1.DataKeys[row.RowIndex].Values[2].ToString(); //RadioButtonList rb = (RadioButtonList)row.FindControl("rdoOpcion"); //string z= pk + " - " + rb.SelectedValue; BL_SOLPED obj = new BL_SOLPED(); DataTable dt = new DataTable(); ScriptManager.RegisterStartupScript(this, typeof(Page), "myScript", "popupAndamios(" + CECOS_GESTOR + "," + IDE_ANDAMIOS + 300 + "," + 300 + ");", true); }
protected void Actualizar(object sender, EventArgs e) { ImageButton btnUpdate = ((ImageButton)sender); GridViewRow grdrow = (GridViewRow)((ImageButton)sender).NamingContainer; string IDE_ANDAMIOS = GridView1.DataKeys[grdrow.RowIndex].Values["IDE_ANDAMIOS"].ToString(); string CECOS_GESTOR = GridView1.DataKeys[grdrow.RowIndex].Values["CECOS_GESTOR"].ToString(); //string z= pk + " - " + rb.SelectedValue; BL_SOLPED obj = new BL_SOLPED(); DataTable dt = new DataTable(); ScriptManager.RegisterStartupScript(this, typeof(Page), "myScript", "EditarSol('" + CECOS_GESTOR + "','" + IDE_ANDAMIOS + "'," + 500 + "," + 400 + ");", true); }
protected void privilegios() { BL_SOLPED obj = new BL_SOLPED(); DataTable dtResultado = new DataTable(); dtResultado = obj.uspSEL_RESPONSABLE_PROCESOS(Session["IDE_USUARIO"].ToString(), "RESPONSABLE MDP", BL_Session.ID_EMPRESA.ToString()); if (dtResultado.Rows.Count < 1) { Response.Redirect("~/operaciones/PermisosMenu.aspx"); //string cleanMessage = "No cuenta con permisos"; //ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); } }
protected void ControlCecos() { BL_SOLPED obj = new BL_SOLPED(); DataTable dtResultado = new DataTable(); dtResultado = obj.uspSEL_RESPONSABLE_PROCESOS_CENTRO(Session["IDE_USUARIO"].ToString(), "RESPONSABLE ALMACEN"); if (dtResultado.Rows.Count > 0) { ddlcentro.DataSource = dtResultado; ddlcentro.DataTextField = "CENTRO"; ddlcentro.DataValueField = "CENTRO"; ddlcentro.DataBind(); } }
protected void btnEquipo1_Click(object sender, EventArgs e) { BL_SOLPED obj = new BL_SOLPED(); DataTable dtResultado = new DataTable(); dtResultado = obj.uspSEL_RESPONSABLE_PROCESOS(Session["IDE_USUARIO"].ToString(), "RESPONSABLE ALQUILER", BL_Session.ID_EMPRESA.ToString()); if (dtResultado.Rows.Count > 0) { Response.Redirect("~/CAREMENOR/EquiposMayoresAlquiler.aspx"); } else { Response.Redirect("~/CAREMENOR/EquiposMayoresAlquilerView.aspx"); } }
protected void ControlProceso() { BL_SOLPED obj = new BL_SOLPED(); DataTable dtResultado = new DataTable(); dtResultado = obj.uspSEL_RESPONSABLE_PROCESOS(Session["IDE_USUARIO"].ToString(), "RESPONSABLE ANDAMIOS", BL_Session.ID_EMPRESA.ToString()); if (dtResultado.Rows.Count > 0) { ddlcentro.DataSource = dtResultado; ddlcentro.DataTextField = "CENTRO"; ddlcentro.DataValueField = "CENTRO"; ddlcentro.DataBind(); ddlcentro.Items.Insert(0, new ListItem("--- TODOS ---", "")); } }
protected void ControlCecos() { BL_SOLPED obj = new BL_SOLPED(); DataTable dtResultado = new DataTable(); //dtResultado = obj.uspSEL_RESPONSABLE_PROCESOS_CENTRO(Session["IDE_USUARIO"].ToString(), "RESPONSABLE ALMACEN"); dtResultado = obj.uspSEL_RESPONSABLE_PROCESOS_SOLPED(Session["IDE_USUARIO"].ToString(), "RESPONSABLE ALMACEN", ddlEmpresa.SelectedValue.ToString()); if (dtResultado.Rows.Count > 0) { ddlcentro.DataSource = dtResultado; ddlcentro.DataTextField = "CENTRO"; ddlcentro.DataValueField = "CENTRO"; ddlcentro.DataBind(); //ddlcentro.Items.Insert(0, new ListItem("--- TODOS ---", "")); } }
protected void ControlProcesoEmpresa() { BL_SOLPED obj = new BL_SOLPED(); DataTable dtResultado = new DataTable(); dtResultado = obj.uspSEL_RESPONSABLE_PROCESOS_EMPRESA(Session["IDE_USUARIO"].ToString(), "RESPONSABLE ALMACEN"); if (dtResultado.Rows.Count > 0) { ddlEmpresa.DataSource = dtResultado; ddlEmpresa.DataTextField = "DES_ABREV"; ddlEmpresa.DataValueField = "ID_EMPRESA"; ddlEmpresa.DataBind(); //ddlEmpresa.Items.Insert(0, new ListItem("--- TODOS ---", "")); ControlProceso(); } }
protected void btnEquipo2_Click(object sender, EventArgs e) { BL_SOLPED obj = new BL_SOLPED(); DataTable dtResultado = new DataTable(); dtResultado = obj.uspSEL_RESPONSABLE_PROCESOS(Session["IDE_USUARIO"].ToString(), "RESPONSABLE ALQUILER", BL_Session.ID_EMPRESA.ToString()); if (dtResultado.Rows.Count > 0) { Response.Redirect("~/CAREMENOR/EquiposMayoresAlquilerMenor.aspx"); } else { Response.Redirect("~/CAREMENOR/EquiposMayoresAlquilerMenorView.aspx"); //string cleanMessage = "No cuenta con permisos"; //ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); } }
protected void Procesar(object sender, ImageClickEventArgs e) { ImageButton btnProcesar = ((ImageButton)sender); GridViewRow row = btnProcesar.NamingContainer as GridViewRow; string pk = GridView1.DataKeys[row.RowIndex].Values[0].ToString(); //RadioButtonList rb = (RadioButtonList)row.FindControl("rdoOpcion"); //string z= pk + " - " + rb.SelectedValue; BL_SOLPED obj = new BL_SOLPED(); DataTable dt = new DataTable(); //lblrpta.Text = rb.SelectedValue.ToString(); //if (rb.SelectedValue == "R") //{ // ModalRegistro.Show(); // lblCodigo.Text = pk.ToString(); // lblMensaje.Visible = false; // txtSolped.Visible = false; //} //else if (rb.SelectedValue == "A") //{ // lblMensaje.Visible = true ; // txtSolped.Visible = true; // ModalRegistro.Show(); // lblCodigo.Text = pk.ToString(); //} //else if (rb.SelectedValue == "AP") //{ // lblMensaje.Visible = true; // txtSolped.Visible = true; // ModalRegistro.Show(); // lblCodigo.Text = pk.ToString(); //} //else //{ // dt = obj.uspUPD_SOLPED_PROCESAR(Convert.ToInt32(pk), rb.SelectedValue, "", Session["IDE_USUARIO"].ToString(),txtSustento.Text.Trim()); // string cleanMessage = "Registro procesado"; // ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); // Listar(); //} }
protected void Listar() { string estado = string.Empty; if (ddlEstados.SelectedIndex == 0) { estado = string.Empty; } else { estado = ddlEstados.SelectedValue.ToString(); } BL_SOLPED obj = new BL_SOLPED(); DataTable dtResultado = new DataTable(); string anio = string.Empty; if (ddlanio.SelectedIndex == 0) { anio = string.Empty; } else { anio = ddlanio.SelectedValue.ToString(); } dtResultado = obj.uspSEL_SOLPED_USUARIO(Session["IDE_USUARIO"].ToString(), estado, anio); if (dtResultado.Rows.Count > 0) { GridView1.Visible = true; GridView1.DataSource = dtResultado; GridView1.DataBind(); } else { GridView1.Visible = false; GridView1.DataSource = dtResultado; GridView1.DataBind(); } }
protected void privilegios() { BL_SOLPED obj = new BL_SOLPED(); DataTable dtResultado = new DataTable(); dtResultado = obj.uspSEL_RESPONSABLE_PROCESOS(Session["IDE_USUARIO"].ToString(), "RESPONSABLE ALQUILER", BL_Session.ID_EMPRESA.ToString()); if (dtResultado.Rows.Count < 1) { // string cleanMessage = "No cuenta con permisos"; //ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); HdCC.Value = BL_Session.CENTRO_COSTO.ToString(); rpt_cuadroOR(BL_Session.CENTRO_COSTO); rpt_cuadro(BL_Session.CENTRO_COSTO); } else { BL_TBL_RequerimientoSubDetalle objx = new BL_TBL_RequerimientoSubDetalle(); DataTable dt = new DataTable(); HdCC.Value = string.Empty; rpt_cuadroOR(""); rpt_cuadro(""); } }
protected void Listar(string txtTicket_H, string txtC_CENTRO_H, string txtD_CENTRO_H) { string estado = string.Empty; if (ddlEstado.SelectedIndex == 0) { estado = string.Empty; } else { estado = ddlEstado.SelectedValue.ToString(); } string IPCENTRO = string.Empty; //if (ddlCentro.SelectedIndex == 0) //{ // IPCENTRO = string.Empty; // if (txtC_CENTRO_H != string.Empty) // { // IPCENTRO = txtC_CENTRO_H; // } //} //else //{ // IPCENTRO = ddlCentro.SelectedValue.ToString(); // if (txtC_CENTRO_H != string.Empty) // { // IPCENTRO = txtC_CENTRO_H; // } //} int contarCC = Convert.ToInt32(ddlCentro.Items.Count.ToString()); if (contarCC <= 1) { IPCENTRO = ddlCentro.SelectedValue.ToString(); } else { if (ddlCentro.SelectedIndex == 0) { IPCENTRO = string.Empty; } else { if (txtC_CENTRO_H != string.Empty) { IPCENTRO = txtC_CENTRO_H; } else { IPCENTRO = ddlCentro.SelectedValue.ToString(); if (txtC_CENTRO_H != string.Empty) { IPCENTRO = txtC_CENTRO_H; } } } } DataTable dtResultado = new DataTable(); BL_CARTA_COBRAZAS obj = new BL_CARTA_COBRAZAS(); dtResultado = obj.uspSEL_CARTA_COBRAZAS(Convert.ToInt32(ddlanio.SelectedValue), Session["IDE_USUARIO"].ToString(), IPCENTRO, estado, txtTicket_H, txtD_CENTRO_H); if (dtResultado.Rows.Count > 0) { //lstRol.DataSource = dtResultado; //lstRol.DataBind(); GridView1.DataSource = dtResultado; GridView1.DataBind(); } else { //lstRol.DataSource = dtResultado; //lstRol.DataBind(); GridView1.DataSource = dtResultado; GridView1.DataBind(); } BL_SOLPED objx = new BL_SOLPED(); DataTable dtResultadox = new DataTable(); dtResultadox = objx.uspSEL_RESPONSABLE_PROCESOS(Session["IDE_USUARIO"].ToString(), "RESPONSABLE CARTA DE COBRANZA (SAP)", BL_Session.ID_EMPRESA.ToString()); if (dtResultadox.Rows.Count > 0) { foreach (GridViewRow row in GridView1.Rows) { ImageButton btnGuardar = (ImageButton)row.FindControl("btnGuardar"); btnGuardar.Visible = true; } } else { foreach (GridViewRow row in GridView1.Rows) { ImageButton btnGuardar = (ImageButton)row.FindControl("btnGuardar"); btnGuardar.Visible = false; } } ScriptManager.RegisterStartupScript(this, typeof(Page), "myScript", "gridviewScroll();", true); }
protected void btnviar_Click(object sender, EventArgs e) { string cleanMessage = string.Empty; if (txtFecha.Text.Trim() == string.Empty) { cleanMessage = "Ingresar fecha de solicitud"; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); } else if (txtCodigo.Text.Trim() == string.Empty) { cleanMessage = "Ingresar codigo"; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); } else if (ddlTipo.SelectedIndex == 0) { cleanMessage = "Falta indicar tipo de solicitud"; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); } else if (ddlPersonal.SelectedValue == string.Empty) { cleanMessage = "Falta indicar personal solicitante"; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); } else { // Si el directorio no existe, crearlo if (!Directory.Exists(Server.MapPath(FolderSOLPED))) { Directory.CreateDirectory(FolderSOLPED); } String fileExtension = string.Empty; Boolean fileOK = false; string fileArchivo = string.Empty; if (FileUpload1.HasFile) { string fileName = FileUpload1.FileName.ToString(); int length = FileUpload1.PostedFile.ContentLength; fileExtension = Path.GetExtension(FileUpload1.FileName); String[] allowedExtensions = { ".gif", ".png", ".jpeg", ".jpg", ".pdf", ".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx", ".txt" }; for (int i = 0; i < allowedExtensions.Length; i++) { if (fileExtension.ToUpper() == allowedExtensions[i].ToUpper()) { fileOK = true; } } } if (fileOK) { try { // Se carga la ruta física de la carpeta temp del sitio string ruta = Server.MapPath(FolderSOLPED); string rutaBackups = FolderSOLPEDBackups; // Si el directorio no existe, crearlo if (!Directory.Exists(ruta)) { Directory.CreateDirectory(ruta); } string archivo = String.Format("{0}\\{1}", ruta, FileUpload1.PostedFile.FileName); // Verificar que el archivo no exista if (File.Exists(archivo)) { fileArchivo = ddlcentro.SelectedValue.ToString() + "_" + txtCodigo.Text.Trim() + "_" + DateTime.UtcNow.ToFileTimeUtc() + Path.GetExtension(FileUpload1.PostedFile.FileName); FileUpload1.SaveAs(ruta + fileArchivo); FileUpload1.SaveAs(rutaBackups + fileArchivo); } else { fileArchivo = ddlcentro.SelectedValue.ToString() + "_" + txtCodigo.Text.Trim() + "_" + Path.GetFileName(FileUpload1.FileName); //FileUpload1.SaveAs(archivo); FileUpload1.SaveAs(ruta + fileArchivo); FileUpload1.SaveAs(rutaBackups + fileArchivo); } BE_SOLPED oBESol = new BE_SOLPED(); oBESol.IDE_SOLPED = Convert.ToInt32(string.IsNullOrEmpty(lblCodigo.Text) ? "0" : lblCodigo.Text); oBESol.FECHA = txtFecha.Text.Trim(); oBESol.IDE_USUARIO = Session["IDE_USUARIO"].ToString(); oBESol.FILE_SOLPED = fileArchivo; oBESol.FILE_RUTA = FolderSOLPED; oBESol.COMENTARIOS = txtcomentarios.Text.ToString(); oBESol.IPCENTRO = ddlcentro.SelectedValue.ToString(); //BL_Session.IP_CENTRO.ToString(); oBESol.CODIGO = txtCodigo.Text.Trim(); oBESol.CODIGO_SI = txtSI.Text.Trim(); oBESol.SOLICITANTE = ddlPersonal.SelectedValue.ToString(); oBESol.TIPO_SOLICITUD = ddlTipo.SelectedValue.ToString(); oBESol.IDE_EMPRESA = ddlEmpresa.SelectedValue.ToString(); int dtrpta = 0; dtrpta = new BL_SOLPED().uspINS_SOLPED(oBESol); if (dtrpta > 0) { Listar(); BL_SOLPED objCorreo = new BL_SOLPED(); objCorreo.SP_ENVIARCORREO_SOLPED(dtrpta, Session["IDE_USUARIO"].ToString()); cleanMessage = "Registro exitoso."; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); lblCodigo.Text = string.Empty; txtCodigo.Text = string.Empty; txtcomentarios.Text = string.Empty; txtSI.Text = string.Empty; ddlPersonal.Text = string.Empty; //CheckSI.Checked = false; } else { cleanMessage = "Advertencia: Codigo ingresado ya se encuentra registrado."; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); } } catch (Exception ex) { cleanMessage = "Archivo no puedo ser cargado"; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); } } else { cleanMessage = "Falta cargar archivo de solicitud"; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); } } }
protected void Listar(string txtFecSol_F, string txtNOM_CREADO_F, string txtNOM_SOLICITA_F, string txtTICKET_F) { string estado = string.Empty; if (ddlEstados.SelectedIndex == 0) { estado = string.Empty; } else { estado = ddlEstados.SelectedValue.ToString(); } string centro = string.Empty; if (ddlcentro.SelectedIndex == 0) { centro = string.Empty; } else { centro = ddlcentro.SelectedValue.ToString(); } string anio = string.Empty; if (ddlanio.SelectedIndex == 0) { anio = string.Empty; } else { anio = ddlanio.SelectedValue.ToString(); } string IDE_EMPRESA = string.Empty; //if (ddlEmpresa.SelectedIndex == 0) //{ // IDE_EMPRESA = string.Empty; //} //else //{ // IDE_EMPRESA = ddlEmpresa.SelectedValue.ToString(); //} IDE_EMPRESA = ddlEmpresa.SelectedValue.ToString(); BL_SOLPED obj = new BL_SOLPED(); DataTable dtResultado = new DataTable(); dtResultado = obj.uspSEL_SOLPED_BANDEJA(Session["IDE_USUARIO"].ToString(), estado, anio, txtFecSol_F, txtNOM_CREADO_F, txtNOM_SOLICITA_F, txtTICKET_F, centro, hfPerfil.Value, IDE_EMPRESA); if (dtResultado.Rows.Count > 0) { GridView1.Visible = true; GridView1.DataSource = dtResultado; GridView1.DataBind(); } else { GridView1.Visible = false; GridView1.DataSource = dtResultado; GridView1.DataBind(); } }