agregando las entregas locales

This commit is contained in:
Antonio Gonzalez
2020-05-23 00:32:26 -07:00
parent fd49875cb7
commit 783b7a6a74
9 changed files with 578 additions and 69 deletions

View 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"));
}
}