/// <summary> /// Autor: jlucero /// Fecha: 2015-06-16 /// </summary> /// <param name="__a"></param> /// <returns></returns> /// public ActionResult Descarga() { var grid = new System.Web.UI.WebControls.GridView(); var collection = new NOperario().NLista(); grid.DataSource = from d in collection select new { ID = d.ope_id, DOCUMENTO = d.ope_documento, APELLIDOS_Y_NOMBRES = d.ope_nombre, TIPO_USUARIO = d.ope_tipo_usuario, CELULAR = d.ope_celular, ESTADO = (d.ope_estado == 2 ? "Inactivo" : "Activo") }; grid.DataBind(); Response.ClearContent(); Response.AddHeader("content-disposition", "attachment; filename=Operario_Listado.xls"); Response.ContentType = "application/x-ms-excel"; StringWriter sw = new StringWriter(); HtmlTextWriter htw = new HtmlTextWriter(sw); grid.RenderControl(htw); Response.Write(sw.ToString()); Response.End(); return(null); }
public ActionResult Actualiza(string __a, string __b, string __c, string __d, string __e, string __f, string __g, string __h, string __i, string __j, string __k, string __l, string __m, string __mail) { Int32 respuesta = new NOperario().NActualiza( new Request_CRUD_Operario() { ope_id = Convert.ToInt32(__a), emp_id = ((Sesion)Session["Session_Usuario_Acceso"]).empresa.emp_id, loc_id = Convert.ToInt32(__b), ope_documento = __c, ope_documento_tipo = __d, ope_apellido = __e, ope_nombre = __f, ope_foto = __g, ope_celular = __h, ope_usuario = __i, ope_contrasenia = __j, ope_online = __k, ope_estado = Convert.ToInt32(__l), ope_crea = ((Sesion)Session["Session_Usuario_Acceso"]).usuario.usu_id, ope_tipo_usuario = __m, ope_email = __mail } ); return(new ContentResult { Content = "{ \"__a\": " + respuesta + " }", ContentType = "application/json" }); }
public ActionResult Anula(string __a, string __b) { Int32 respuesta = new NOperario().NAnula( new Request_CRUD_Operario() { ope_id = Convert.ToInt32(__a), ope_estado = Convert.ToInt32(__b), ope_crea = ((Sesion)Session["Session_Usuario_Acceso"]).usuario.usu_id } ); return(new ContentResult { Content = "{ \"__a\": " + respuesta + " }", ContentType = "application/json" }); }