agregando las entregas locales
This commit is contained in:
79
Inventarios/EntregasPorRealizar.aspx.cs
Normal file
79
Inventarios/EntregasPorRealizar.aspx.cs
Normal file
@@ -0,0 +1,79 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Data;
|
||||
using Extensiones;
|
||||
|
||||
public partial class Inventarios_EntregasPorRealizar : ClsPaginas
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
CargarEntregas();
|
||||
CargarPersonal();
|
||||
}
|
||||
}
|
||||
|
||||
protected void BtnAsignar_Click(object sender,EventArgs e)
|
||||
{
|
||||
if (DdlPersonal.SelectedValue.ToEntero() > 0)
|
||||
{
|
||||
bool TieneError = false;
|
||||
ClsGenerales ObjGeneral = new ClsGenerales();
|
||||
ObjGeneral.IniciaTransacSQL();
|
||||
GridViewRowCollection Grid = GvPaqueteriasGuias.Rows;
|
||||
|
||||
foreach (GridViewRow row in Grid)
|
||||
{
|
||||
if (row.FCCheckBox("ChkAsigna").Checked)
|
||||
{
|
||||
int CvePaqueteriasGuias = row.DataKey("CvePaqueteriaGuia").ToEntero();
|
||||
int CvePersonal = DdlPersonal.SelectedValue.ToEntero();
|
||||
|
||||
if(!ObjGeneral.AsignarEntregasPorRealizar(CvePaqueteriasGuias, CvePersonal)){
|
||||
TieneError = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!TieneError)
|
||||
{
|
||||
ObjGeneral.Commit();
|
||||
Alert("Entregas asignadas correctamente");
|
||||
CargarEntregas();
|
||||
UpDatos.Update();
|
||||
}
|
||||
else
|
||||
{
|
||||
ObjGeneral.RollBack();
|
||||
}
|
||||
ObjGeneral.Dispose();
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert("Seleccione a alguien del personal",ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||
}
|
||||
}
|
||||
|
||||
private void CargarEntregas()
|
||||
{
|
||||
ClsGenerales ObjGeneral = new ClsGenerales();
|
||||
if (ObjGeneral.GetEntregasPorRealizar(UsuarioActual.CveEmpresa))
|
||||
{
|
||||
GvPaqueteriasGuias.DataSource = ObjGeneral.DtResultados;
|
||||
GvPaqueteriasGuias.DataBind();
|
||||
}
|
||||
ObjGeneral.Dispose();
|
||||
}
|
||||
|
||||
private void CargarPersonal()
|
||||
{
|
||||
DdlPersonal.DataSource = get_GlobalDTRHPersonal(UsuarioActual.CveEmpresa);
|
||||
DdlPersonal.DataBind();
|
||||
DdlPersonal.Items.Insert(0, new ListItem("Seleccione", "-1"));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user