private void TotenAdmisionForm_Load(object sender, EventArgs e) { var bloque = int.Parse(ConfigurationManager.AppSettings["Bloque"]); var servicios = ServicioBL.Listar(x => x.BloqueId == bloque); var i = servicios.Count; if (i == 1) { btn1.Visible = true; btn1.Text = servicios[0].Denominacion; btn1.Tag = servicios[0].Id; btn2.Visible = false; } if (i == 2) { btn1.Visible = true; btn1.Text = servicios[0].Denominacion; btn1.Tag = servicios[0].Id; btn2.Visible = true; btn2.Text = servicios[1].Denominacion; btn2.Tag = servicios[1].Id; } }
public Proveedores() { InitializeComponent(); _proveedores = new ProveedoresBL(); listaProveedoresBindingSource.DataSource = _proveedores.ObtenerProveedores(); _servicios = new ServicioBL(); listaServiciosBindingSource.DataSource = _servicios.ObtenerServicio(); }
public ActionResult Mantener(int id = 0) { ViewBag.cboBloque = new SelectList(BloqueBL.Listar(), "Id", "Denominacion"); if (id == 0) { return(View(new Datos.Servicio() { Estado = true })); } else { return(View(ServicioBL.Obtener(id))); } }
protected void btnExcel_Click(object sender, ImageClickEventArgs e) { try { ServicioBL oMaestroServicioBL = new ServicioBL(); objServBE.Co_Servicio = txtCodigo.Text.Trim(); objServBE.No_Servicio = txtNom.Text.Trim();; objServBE.Id_TipoServicio = Int32.Parse(cboTServicio.SelectedValue.ToString()); objServBE.Fl_activo = CboEstado.SelectedValue.ToString(); this.oMaestroServicioBEList = oMaestroServicioBL.BusqServicioList(objServBE); const string RUTA_DOCUMENTOS = ConstanteBE.RUTA_MANTENIMIENTO_SRC; String carpeta = String.Empty, nombre = String.Empty, RutaFinal = String.Empty; String ruta = Convert.ToString(ConfigurationManager.AppSettings["FileServerPath"]) + RUTA_DOCUMENTOS; ruta = Utility.CrearCarpetaFileServer(ruta); String fl_Ruta = ConstanteBE.FLAT_EXCEL_SRC; ExportarExcelXml oExportarExcelXml = new ExportarExcelXml(); String archivo = oExportarExcelXml.GenerarExcelExportarServicio(this.oMaestroServicioBEList, ruta); if (!archivo.Equals("-1")) { nombre = archivo; carpeta = Utility.ObtenerCarpetaFileServer(nombre); archivo = Convert.ToString(ConfigurationManager.AppSettings["FileServerPath"]) + RUTA_DOCUMENTOS + carpeta + @"\" + Convert.ToString(nombre.Trim()); if (File.Exists(archivo)) { this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), String.Empty, "<script> window.open('../SGS_Comunes/SGS_VerExcelExpotable.aspx?nombreArchivo=" + nombre + "&flatRuta=" + fl_Ruta + "')</script>"); } } else { JavaScriptHelper.Alert(this, "'Problemas al generar el excel, consulte con el administrador.'", String.Empty); } } catch (Exception ex) { Master.Web_ErrorEvent(this, ex); JavaScriptHelper.Alert(this, ex.Message.ToString(), String.Empty); } }
public ActionResult Mantener(int id = 0) { ViewBag.cboUsuario = new SelectList(UsuarioBL.Listar(null, x => x.OrderByDescending(y => y.Id)), "Id", "Denominacion"); ViewBag.cboServicio = new SelectList(ServicioBL.Listar(null, x => x.OrderByDescending(y => y.Id)), "Id", "Denominacion"); ViewBag.cboBloque = new SelectList(BloqueBL.Listar(), "Id", "Denominacion"); ViewBag.cboUsuario = new SelectList(UsuarioBL.Listar(), "Id", "NombreCompleto"); ViewBag.cboServicio = new SelectList(ServicioBL.Listar(), "Id", "Denominacion"); if (id == 0) { return(View(new Datos.Ventanilla() { })); } else { return(View(VentanillaBL.Obtener(id))); } }
public ActionResult Guardar(Datos.Servicio servicio, string activo) { var rm = new Comun.ResponseModel(); servicio.Estado = string.IsNullOrEmpty(activo) ? false : true; try { if (servicio.Id == 0) { ServicioBL.Crear(servicio); } else { ServicioBL.ActualizarParcial(servicio, x => x.Denominacion, x => x.BloqueId, x => x.Estado); } rm.SetResponse(true); rm.href = Url.Action("Index", "Servicio"); } catch (Exception ex) { rm.SetResponse(false, ex.Message); } return(Json(rm, JsonRequestBehavior.AllowGet)); }
// GET: Servicio public ActionResult Index() { return(View(ServicioBL.Listar(includeProperties: "Bloque"))); }