-
This commit is contained in:
@@ -44,7 +44,7 @@
|
||||
<div class="modal-header ">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title">
|
||||
<asp:Literal ID="LtlTituloModalTiposD" runat="server">Tipo Gastos de Rechazo</asp:Literal></h4>
|
||||
<asp:Literal ID="LtlTituloModalTiposD" runat="server">Tipo de Servicio</asp:Literal></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlTipoMantenimiento" DataTextField="TipoMantenimiento" DataValueField="CveTipoMantenimiento" CausesValidation="true" runat="server" Width="100%" AppendDataBoundItems="true" CssClass="form-control input-sm select2me"></asp:DropDownList>
|
||||
<label for="<%= DdlTipoMantenimiento.ClientID.ToString()%>">Tipo Mantenimiento:</label>
|
||||
<asp:RequiredFieldValidator ID="RFVTipoMantenimiento" CssClass="help-block errorimput" runat="server" ControlToValidate="DdlTipoProceso" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo Mantenimiento''</b> es necesario." InitialValue="-1" ValidationGroup="GrpTiposD"></asp:RequiredFieldValidator>
|
||||
<asp:RequiredFieldValidator ID="RFVTipoMantenimiento" CssClass="help-block errorimput" runat="server" ControlToValidate="DdlTipoMantenimiento" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo Mantenimiento''</b> es necesario." InitialValue="-1" ValidationGroup="GrpTiposD"></asp:RequiredFieldValidator>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
|
||||
@@ -24,7 +24,10 @@ public partial class AF_CatTiposServicios : ClsPaginas
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
if (!IsPostBack)
|
||||
{
|
||||
CargaDatos();
|
||||
}
|
||||
}
|
||||
|
||||
private void CargaDatos()
|
||||
@@ -35,6 +38,12 @@ public partial class AF_CatTiposServicios : ClsPaginas
|
||||
GvDatos.DataSource = ObjAF.DtResultados;
|
||||
GvDatos.DataBind();
|
||||
}
|
||||
|
||||
if (ObjAF.GetTiposMantenimiento(-1))
|
||||
{
|
||||
DdlTipoMantenimiento.DataSource = ObjAF.DtResultados;
|
||||
DdlTipoMantenimiento.DataBind();
|
||||
}
|
||||
ObjAF.Dispose();
|
||||
}
|
||||
|
||||
@@ -97,5 +106,6 @@ public partial class AF_CatTiposServicios : ClsPaginas
|
||||
}
|
||||
}
|
||||
ObjAF.Dispose();
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD"));
|
||||
}
|
||||
}
|
||||
84
AF/CatTiposServiciosActividades.aspx
Normal file
84
AF/CatTiposServiciosActividades.aspx
Normal file
@@ -0,0 +1,84 @@
|
||||
<%@ Page Title="AF - Catálogo de Actividades de Tipos de Servicio" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="CatTiposServiciosActividades.aspx.cs" Inherits="AF_CatTiposServiciosActividades" %>
|
||||
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
Catálogo de Actividades de Tipos de Servicio
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<asp:UpdatePanel runat="server" ID="UpAgregar">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton runat="server" ID="BtnAgregarTipoServicioD" OnClick="BtnAgregarTipoServicioD_Click" data-toggle="tooltip" data-placement="left" title="Agregar un Defecto" Text="<i class='fa fa-plus'></i>Agregar una Actividad"></asp:LinkButton>
|
||||
</li>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveTipoServicioActividad,CveActividad,Nombre,Duracion,Observaciones" EmptyDataText="No se encontraron Tipo Gasto" ToolTip="Listado de Tipo Gasto " CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; width: 100%" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="Actividad" DataField="Nombre" />
|
||||
<asp:BoundField HeaderText="Duracion" DataField="Duracion" />
|
||||
<asp:BoundField HeaderText="Observaciones" DataField="Observaciones" />
|
||||
<asp:TemplateField ItemStyle-Width="13%" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Left" HeaderText="Editar">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="LnkEditar" OnClick="LnkEditar_Click" runat="server" Visible="true" AlternateText="Subir" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i title='Editar' class='fa fa-pencil' title='Editar' ></i>" />
|
||||
<asp:LinkButton ID="LnkEliminar" OnClick="LnkEliminar_Click" runat="server" Visible="true" AlternateText="Reasignar" CausesValidation="False" CssClass="btn btn-circle btn-sm red" Text="<i title='Reasignar' class='icon-trash' title='Eliminar' ></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div id="DivAgregarTiposServiciosActividadesD" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog" style="width: 450px;">
|
||||
<asp:UpdatePanel runat="server" class="modal-content" ID="UpModalTiposD" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header ">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title">
|
||||
<asp:Literal ID="LtlTituloModalTiposD" runat="server">Actividad de Tipo de Servicio</asp:Literal></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlActividades" DataTextField="Nombre" DataValueField="CveActividad" CausesValidation="true" runat="server" Width="100%" AppendDataBoundItems="true" CssClass="form-control input-sm select2me"></asp:DropDownList>
|
||||
<label for="<%= DdlActividades.ClientID.ToString()%>">Actividad:</label>
|
||||
<asp:RequiredFieldValidator ID="RFVDdlActividades" CssClass="help-block errorimput" runat="server" ControlToValidate="DdlActividades" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Actividad''</b> es necesario." InitialValue="-1" ValidationGroup="GrpTiposD"></asp:RequiredFieldValidator>
|
||||
</div>
|
||||
<br />
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtDuracion" CssClass="form-control " runat="server" MaxLength="70" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RfvTxtDuracion" runat="server" ControlToValidate="TxtDuracion" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Duración''</b> es necesario, por favor ingréselo." ValidationGroup="GrpTiposD"></asp:RequiredFieldValidator>
|
||||
<label for="LblDuracion">Duración:</label>
|
||||
<i></i>
|
||||
</div>
|
||||
<br />
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtObservaciones" CssClass="form-control " runat="server" MaxLength="70" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RfvTxtObservaciones" runat="server" ControlToValidate="TxtObservaciones" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Observacioens''</b> es necesario, por favor ingréselo." ValidationGroup="GrpTiposD"></asp:RequiredFieldValidator>
|
||||
<label for="LblObservacion">Observaciones:</label>
|
||||
<i></i>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="modal-footer">
|
||||
<asp:Button ID="BtnAgregarTipoServicio" OnClick="BtnAgregarTipoServicio_Click" runat="server" class="btn btn-success" Text="Agregar" ValidationGroup="GrpTiposD" />
|
||||
<button id="Button3" runat="server" type="button" class="btn default" data-dismiss="modal">Cancelar</button>
|
||||
</div>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
109
AF/CatTiposServiciosActividades.aspx.cs
Normal file
109
AF/CatTiposServiciosActividades.aspx.cs
Normal file
@@ -0,0 +1,109 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using Extensiones;
|
||||
using System.Data;
|
||||
|
||||
public partial class AF_CatTiposServiciosActividades : ClsPaginas
|
||||
{
|
||||
private int CveTipoServicioActividad
|
||||
{
|
||||
get
|
||||
{
|
||||
return ViewState["CveTipoServicioActividad"].ToString().ToEntero();
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
ViewState["CveTipoServicioActividad"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
CargaDatos();
|
||||
}
|
||||
}
|
||||
|
||||
private void CargaDatos()
|
||||
{
|
||||
ClsAF ObjAF = new ClsAF();
|
||||
if (ObjAF.GetTiposServiciosActividades(-1, -1))
|
||||
{
|
||||
GvDatos.DataSource = ObjAF.DtResultados;
|
||||
GvDatos.DataBind();
|
||||
}
|
||||
|
||||
if (ObjAF.GetActividades(-1,-1,-1,UsuarioActual.CveEmpresa))
|
||||
{
|
||||
DdlActividades.DataSource = ObjAF.DtResultados;
|
||||
DdlActividades.DataBind();
|
||||
}
|
||||
ObjAF.Dispose();
|
||||
}
|
||||
|
||||
protected void BtnAgregarTipoServicioD_Click(object sender, EventArgs e)
|
||||
{
|
||||
BtnAgregarTipoServicio.Text = "Agregar";
|
||||
TxtDuracion.Text = "";
|
||||
TxtObservaciones.Text = "";
|
||||
DdlActividades.SelectedValueExist(-1);
|
||||
UpModalTiposD.Update();
|
||||
RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposServiciosActividadesD"));
|
||||
}
|
||||
|
||||
protected void LnkEditar_Click(object sender, EventArgs e)
|
||||
{
|
||||
BtnAgregarTipoServicio.Text = "Actualizar";
|
||||
GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
||||
CveTipoServicioActividad = GvRow.DataKey("CveTipoServicioActividad").ToEntero();
|
||||
TxtDuracion.Text = GvRow.DataKey("Duracion");
|
||||
TxtObservaciones.Text = GvRow.DataKey("Observaciones");
|
||||
DdlActividades.SelectedValueExist(GvRow.DataKey("CveActividad"));
|
||||
UpModalTiposD.Update();
|
||||
RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposServiciosActividadesD"));
|
||||
}
|
||||
|
||||
protected void LnkEliminar_Click(object sender, EventArgs e)
|
||||
{
|
||||
GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
||||
CveTipoServicioActividad = GvRow.DataKey("CveTipoServicioActividad").ToEntero();
|
||||
ClsAF ObjAF = new ClsAF();
|
||||
if (ObjAF.DeleteTiposServiciosActividades(CveTipoServicioActividad))
|
||||
{
|
||||
CargaDatos();
|
||||
UpDatos.Update();
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposServiciosActividadesD"));
|
||||
Alert("Se eliminó la Actividad del Tipo de Servicio correctamente");
|
||||
}
|
||||
ObjAF.Dispose();
|
||||
}
|
||||
|
||||
protected void BtnAgregarTipoServicio_Click(object sender, EventArgs e)
|
||||
{
|
||||
ClsAF ObjAF = new ClsAF();
|
||||
if (BtnAgregarTipoServicio.Text == "Agregar")
|
||||
{
|
||||
if (ObjAF.AddTiposServiciosActividades(DdlActividades.SelectedValue.ToEntero(),TxtDuracion.Text.ToEntero(),TxtObservaciones.Text))
|
||||
{
|
||||
Alert("Se agregó la Actividad del Tipo de Servicio correctamente");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ObjAF.UpdateTiposServiciosActividades(CveTipoServicioActividad,DdlActividades.SelectedValue.ToEntero(),TxtDuracion.Text.ToEntero(),TxtObservaciones.Text))
|
||||
{
|
||||
Alert("Se actualizó la Actividad del Tipo de Servicio correctamente");
|
||||
}
|
||||
}
|
||||
ObjAF.Dispose();
|
||||
CargaDatos();
|
||||
UpDatos.Update();
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposServiciosActividadesD"));
|
||||
}
|
||||
}
|
||||
98
AF/CatTiposServiciosMateriales.aspx
Normal file
98
AF/CatTiposServiciosMateriales.aspx
Normal file
@@ -0,0 +1,98 @@
|
||||
<%@ Page Title="AF - Catálogo de Materiales de Tipos de Servicio" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="CatTiposServiciosMateriales.aspx.cs" Inherits="AF_CatTiposServiciosMateriales" %>
|
||||
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
Catálogo de Materiales de Tipos de Servicio
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<asp:UpdatePanel runat="server" ID="UpAgregar">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton runat="server" ID="BtnAgregarTipoServicioD" OnClick="BtnAgregarTipoServicioD_Click" data-toggle="tooltip" data-placement="left" title="Agregar un Defecto" Text="<i class='fa fa-plus'></i>Agregar un Material de Tipo de Servicio"></asp:LinkButton>
|
||||
</li>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveTipoServicioMaterial,CveTipoServicio,Nombre,Cantidad,CveUM,UnidadMedida,CvePS,PS,Tipo" EmptyDataText="No se encontraron Tipo Gasto" ToolTip="Listado de Tipo Gasto " CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; width: 100%" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="Actividad" DataField="Nombre" />
|
||||
<asp:BoundField HeaderText="Cantidad" DataField="Cantidad" />
|
||||
<asp:BoundField HeaderText="UnidadMedida" DataField="UnidadMedida" />
|
||||
<asp:BoundField HeaderText="PS" DataField="PS" />
|
||||
<asp:BoundField HeaderText="Tipo" DataField="Tipo" />
|
||||
<asp:TemplateField ItemStyle-Width="13%" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Left" HeaderText="Editar">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="LnkEditar" OnClick="LnkEditar_Click" runat="server" Visible="true" AlternateText="Subir" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i title='Editar' class='fa fa-pencil' title='Editar' ></i>" />
|
||||
<asp:LinkButton ID="LnkEliminar" OnClick="LnkEliminar_Click" runat="server" Visible="true" AlternateText="Reasignar" CausesValidation="False" CssClass="btn btn-circle btn-sm red" Text="<i title='Reasignar' class='icon-trash' title='Eliminar' ></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div id="DivAgregarTiposServiciosMaterialD" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog" style="width: 450px;">
|
||||
<asp:UpdatePanel runat="server" class="modal-content" ID="UpModalTiposD" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header ">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title">
|
||||
<asp:Literal ID="LtlTituloModalTiposD" runat="server">Material de Tipo de Servicio</asp:Literal></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlTipoServicio" DataTextField="Nombre" DataValueField="CveTipoServicio" CausesValidation="true" runat="server" Width="100%" AppendDataBoundItems="true" CssClass="form-control input-sm select2me"></asp:DropDownList>
|
||||
<label for="<%= DdlTipoServicio.ClientID.ToString()%>">Tipo Servicio:</label>
|
||||
<asp:RequiredFieldValidator ID="RFVDdlTipoServicio" CssClass="help-block errorimput" runat="server" ControlToValidate="DdlTipoServicio" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo Servicio''</b> es necesario." InitialValue="-1" ValidationGroup="GrpTiposD"></asp:RequiredFieldValidator>
|
||||
</div>
|
||||
<br />
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtCantidad" CssClass="form-control " runat="server" MaxLength="70" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RfvTxtCantidad" runat="server" ControlToValidate="TxtCantidad" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cantidad''</b> es necesario, por favor ingréselo." ValidationGroup="GrpTiposD"></asp:RequiredFieldValidator>
|
||||
<label for="TxtCantidad">Cantidad:</label>
|
||||
<i></i>
|
||||
</div>
|
||||
<br />
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlUM" DataTextField="UnidadMedida" DataValueField="CveUnidadMedida" CausesValidation="true" runat="server" Width="100%" AppendDataBoundItems="true" CssClass="form-control input-sm select2me"></asp:DropDownList>
|
||||
<label for="<%= DdlUM.ClientID.ToString()%>">Unidad de Medida:</label>
|
||||
<asp:RequiredFieldValidator ID="RfvDdlUM" CssClass="help-block errorimput" runat="server" ControlToValidate="DdlUM" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Unidad de Medida''</b> es necesario." InitialValue="-1" ValidationGroup="GrpTiposD"></asp:RequiredFieldValidator>
|
||||
</div>
|
||||
<br />
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlPS" DataTextField="PS" DataValueField="CvePS" CausesValidation="true" runat="server" Width="100%" AppendDataBoundItems="true" CssClass="form-control input-sm select2me"></asp:DropDownList>
|
||||
<label for="<%= DdlPS.ClientID.ToString()%>">Producto Servicio:</label>
|
||||
<asp:RequiredFieldValidator ID="RfvDdlPS" CssClass="help-block errorimput" runat="server" ControlToValidate="DdlPS" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Producto Servicio''</b> es necesario." InitialValue="-1" ValidationGroup="GrpTiposD"></asp:RequiredFieldValidator>
|
||||
</div>
|
||||
<br />
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtTipo" CssClass="form-control " runat="server" MaxLength="70" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RfvTxtTipo" runat="server" ControlToValidate="TxtTipo" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpTiposD"></asp:RequiredFieldValidator>
|
||||
<label for="TxtTipo">Tipo:</label>
|
||||
<i></i>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="modal-footer">
|
||||
<asp:Button ID="BtnAgregarTipoServicio" OnClick="BtnAgregarTipoServicio_Click" runat="server" class="btn btn-success" Text="Agregar" ValidationGroup="GrpTiposD" />
|
||||
<button id="Button3" runat="server" type="button" class="btn default" data-dismiss="modal">Cancelar</button>
|
||||
</div>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
120
AF/CatTiposServiciosMateriales.aspx.cs
Normal file
120
AF/CatTiposServiciosMateriales.aspx.cs
Normal file
@@ -0,0 +1,120 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using Extensiones;
|
||||
using System.Data;
|
||||
|
||||
public partial class AF_CatTiposServiciosMateriales : ClsPaginas
|
||||
{
|
||||
private int CveTipoServicioMaterial
|
||||
{
|
||||
get
|
||||
{
|
||||
return ViewState["CveTipoServicioMaterial"].ToString().ToEntero();
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
ViewState["CveTipoServicioMaterial"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
CargaDatos();
|
||||
}
|
||||
}
|
||||
|
||||
private void CargaDatos()
|
||||
{
|
||||
ClsAF ObjAF = new ClsAF();
|
||||
if (ObjAF.GetTiposServiciosMaterial(-1, -1))
|
||||
{
|
||||
GvDatos.DataSource = ObjAF.DtResultados;
|
||||
GvDatos.DataBind();
|
||||
}
|
||||
|
||||
if (ObjAF.GetTiposServicios(-1, -1,-1,UsuarioActual.CveEmpresa))
|
||||
{
|
||||
DdlTipoServicio.DataSource = ObjAF.DtResultados;
|
||||
DdlTipoServicio.DataBind();
|
||||
}
|
||||
|
||||
DdlUM.DataSource = get_GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa);
|
||||
DdlUM.DataBind();
|
||||
|
||||
DdlPS.DataSource = get_GlobalDTPS(UsuarioActual.CveEmpresa);
|
||||
DdlPS.DataBind();
|
||||
|
||||
ObjAF.Dispose();
|
||||
}
|
||||
|
||||
protected void BtnAgregarTipoServicioD_Click(object sender, EventArgs e)
|
||||
{
|
||||
BtnAgregarTipoServicio.Text = "Agregar";
|
||||
TxtCantidad.Text = "";
|
||||
TxtTipo.Text = "";
|
||||
DdlTipoServicio.SelectedValueExist(-1);
|
||||
DdlUM.SelectedValueExist(-1);
|
||||
DdlPS.SelectedValueExist(-1);
|
||||
UpModalTiposD.Update();
|
||||
RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposServiciosMaterialD"));
|
||||
}
|
||||
|
||||
protected void LnkEditar_Click(object sender, EventArgs e)
|
||||
{
|
||||
BtnAgregarTipoServicio.Text = "Actualizar";
|
||||
GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
||||
CveTipoServicioMaterial = GvRow.DataKey("CveTipoServicioMaterial").ToEntero();
|
||||
TxtCantidad.Text = GvRow.DataKey("Cantidad");
|
||||
TxtTipo.Text = GvRow.DataKey("Tipo");
|
||||
DdlTipoServicio.SelectedValueExist(GvRow.DataKey("CveTipoServicio"));
|
||||
DdlPS.SelectedValueExist(GvRow.DataKey("CvePS"));
|
||||
DdlUM.SelectedValueExist(GvRow.DataKey("CveUM"));
|
||||
UpModalTiposD.Update();
|
||||
RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposServiciosMaterialD"));
|
||||
}
|
||||
|
||||
protected void LnkEliminar_Click(object sender, EventArgs e)
|
||||
{
|
||||
GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
||||
CveTipoServicioMaterial = GvRow.DataKey("CveTipoServicioMaterial").ToEntero();
|
||||
ClsAF ObjAF = new ClsAF();
|
||||
if (ObjAF.DeleteTiposServiciosMaterial(CveTipoServicioMaterial))
|
||||
{
|
||||
CargaDatos();
|
||||
UpDatos.Update();
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposServiciosMaterialD"));
|
||||
Alert("Se eliminó el Material del Tipo de Servicio correctamente");
|
||||
}
|
||||
ObjAF.Dispose();
|
||||
}
|
||||
|
||||
protected void BtnAgregarTipoServicio_Click(object sender, EventArgs e)
|
||||
{
|
||||
ClsAF ObjAF = new ClsAF();
|
||||
if (BtnAgregarTipoServicio.Text == "Agregar")
|
||||
{
|
||||
if (ObjAF.AddTiposServiciosMaterial(DdlTipoServicio.SelectedValue.ToEntero(),TxtCantidad.Text.ToDecimal(),DdlUM.SelectedValue.ToEntero(),DdlPS.SelectedValue.ToEntero(),TxtTipo.Text.ToEntero()))
|
||||
{
|
||||
Alert("Se agregó el Material del Tipo de servicio correctamente");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ObjAF.UpdateTiposServiciosMaterial(CveTipoServicioMaterial, DdlTipoServicio.SelectedValue.ToEntero(), TxtCantidad.Text.ToDecimal(), DdlUM.SelectedValue.ToEntero(), DdlPS.SelectedValue.ToEntero(), TxtTipo.Text.ToEntero()))
|
||||
{
|
||||
Alert("Se actualizó el Material del Tipo de servicio correctamente");
|
||||
}
|
||||
}
|
||||
ObjAF.Dispose();
|
||||
CargaDatos();
|
||||
UpDatos.Update();
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposServiciosMaterialD"));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user