-RegistraScript se unifica en una sola clase static/shared y se simplica el código -Alert se vuelve estático -Random() no se manda a crear cada vez que se registra un script (esto tenía un costo alto) -Se corrigieron unos errores en los nombres de funciones -Las clases que ya heredan de Clspaginas, se les quita el this a RegistraScript y a Alert puesto que era innecesario (y además al haberlos vuelto métodos estáticos, NO pueden llamarse de un this)
450 lines
20 KiB
C#
450 lines
20 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using System.Web.UI.WebControls;
|
|
using Extensiones;
|
|
using System.Data;
|
|
using static Extensiones.ModExtensiones;
|
|
using Microsoft.Reporting.WebForms;
|
|
using System.Web.UI;
|
|
|
|
public partial class CATCorte : ClsPaginas
|
|
{
|
|
|
|
#region Propiedades
|
|
|
|
private int CveCorte
|
|
{
|
|
get { return (ViewState["CveCorte"] == null) ? -1 : Convert.ToInt32(ViewState["CveCorte"]); }
|
|
set { ViewState["CveCorte"] = value; }
|
|
}
|
|
private int CveOrdenCorte
|
|
{
|
|
get { return (ViewState["CveOrdenCorte"] == null) ? -1 : Convert.ToInt32(ViewState["CveOrdenCorte"]); }
|
|
set { ViewState["CveOrdenCorte"] = value; }
|
|
}
|
|
private int Index
|
|
{
|
|
get { return (ViewState["Index"] == null) ? 0 : Convert.ToInt32(ViewState["Index"]); }
|
|
set { ViewState["Index"] = value; }
|
|
}
|
|
private String Adjunto
|
|
{
|
|
get { return (ViewState["Adjunto"] == null) ? "-1" : (String)(ViewState["Adjunto"]); }
|
|
set { ViewState["Adjunto"] = value; }
|
|
}
|
|
private int CveHuerta
|
|
{
|
|
get { return (ViewState["CveHuerta"] == null) ? 0 : Convert.ToInt32(ViewState["CveHuerta"]); }
|
|
set { ViewState["CveHuerta"] = value; }
|
|
}
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!IsPostBack)
|
|
{
|
|
CveOrdenCorte = Request["CveOrdenCorte"] == null ? -1 : Request["CveOrdenCorte"].ToString().ToEntero();
|
|
CveHuerta = Request["CveHuerta"] == null ? 0 : Request["CveHuerta"].ToString().ToEntero();
|
|
txtFechaI.Text = DateTime.Now.AddMonths(-1).ToShortDateString();
|
|
txtFechaF.Text = DateTime.Now.ToShortDateString();
|
|
CargaMotivo();
|
|
CargaOrdenCorte();
|
|
CargaHuerta();
|
|
CargaEmpaque();
|
|
CargaBitacora();
|
|
CargaFletes();
|
|
if (CveHuerta > 0) { DdlHuertaFiltro.SelectedValueExist(CveHuerta); }
|
|
CargaCorte();
|
|
if (CveOrdenCorte > 0) { Agregar(); }
|
|
}
|
|
}
|
|
|
|
|
|
|
|
#region Cargas
|
|
protected void CargaCorte()
|
|
{
|
|
ClsCGame ObjCort = new ClsCGame();
|
|
if (ObjCort.GetCorte(UsuarioActual.CveEmpresa, Estatus: DdlEstatus.SelectedValue.ToEntero(), CveHuerta: DdlHuertaFiltro.SelectedValue.ToEntero(), Opcion: 1,FechaI:txtFechaI.Text.ToDate(),FechaF:txtFechaF.Text.ToDate()))
|
|
{
|
|
GVCorte.DataSource = ObjCort.DtResultados;
|
|
}
|
|
ObjCort.Dispose();
|
|
GVCorte.DataBind();
|
|
upDatosCort.Update();
|
|
}
|
|
protected void CargaHuerta()
|
|
{
|
|
ClsCGame ObjCort = new ClsCGame();
|
|
if (ObjCort.GetHuerta(UsuarioActual.CveEmpresa))
|
|
{
|
|
DdlHuertaFiltro.DataSource = ObjCort.DtResultados;
|
|
DdlHuertaFiltro.Items.Insert(0, new ListItem("Todos", "-1"));
|
|
}
|
|
ObjCort.Dispose(); ;
|
|
DdlHuertaFiltro.DataBind();
|
|
UpFiltros.Update();
|
|
}
|
|
|
|
protected void CargaOrdenCorte(int CveOrdenCorte = -1)
|
|
{
|
|
DdlOrdenCorte.Items.Clear();
|
|
ClsCGame ObjCGame = new ClsCGame();
|
|
if (ObjCGame.GetOrdenCorte(UsuarioActual.CveEmpresa))
|
|
{
|
|
if (CveOrdenCorte < 1)
|
|
{
|
|
DdlOrdenCorte.DataSource = ObjCGame.DtResultados.FiltraParametros("Disponible = 1");
|
|
}
|
|
else
|
|
{
|
|
DdlOrdenCorte.DataSource = ObjCGame.DtResultados.FiltraParametros(String.Format("Disponible = 1 OR CveOrdenCorte = {0}", CveOrdenCorte));
|
|
}
|
|
DdlOrdenCorte.Items.Insert(0, new ListItem("Seleccione", "-1"));
|
|
}
|
|
ObjCGame.Dispose();
|
|
DdlOrdenCorte.DataBind();
|
|
UPModalCort.Update();
|
|
}
|
|
|
|
protected void CargaMotivo()
|
|
{
|
|
ClsCGame ObjCort = new ClsCGame();
|
|
if (ObjCort.GetMotivoMerma(UsuarioActual.CveEmpresa))
|
|
{
|
|
DdlMotivo.DataSource = ObjCort.DtResultados;
|
|
DdlMotivo.Items.Insert(0, new ListItem("Seleccione", "-1"));
|
|
DdlMotivo.DataBind();
|
|
}
|
|
ObjCort.Dispose();
|
|
UPModalCort.Update();
|
|
}
|
|
|
|
private void CargaEmpaque()
|
|
{
|
|
ClsCGame ObjCGame = new ClsCGame();
|
|
if (ObjCGame.GetEmpaques(UsuarioActual.CveEmpresa, -1, 1))
|
|
{
|
|
DdlEmpaque.DataSource = ObjCGame.DtResultados;
|
|
DdlEmpaque.Items.Insert(0, new ListItem("Seleccione", "-1"));
|
|
}
|
|
ObjCGame.Dispose();
|
|
DdlEmpaque.DataBind();
|
|
}
|
|
|
|
private void CargaBitacora()
|
|
{
|
|
ClsCGame ObjCGame = new ClsCGame();
|
|
if (ObjCGame.GetBitacora(UsuarioActual.CveEmpresa))
|
|
{
|
|
GvBitacora.DataSource = ObjCGame.DtResultados;
|
|
}
|
|
ObjCGame.Dispose();
|
|
GvBitacora.DataBind();
|
|
UpBitacora.Update();
|
|
}
|
|
|
|
private void CargaFletes(int CveFlete = -1)
|
|
{
|
|
DdlFlete.Items.Clear();
|
|
if (DdlOrdenCorte.SelectedValue.ToEntero() != -1)
|
|
{
|
|
ClsCGame ObjCGame = new ClsCGame();
|
|
if (ObjCGame.GetFlete(UsuarioActual.CveEmpresa, CveOrdenCorte: DdlOrdenCorte.SelectedValue.ToEntero()))
|
|
{
|
|
if (CveFlete < 1)
|
|
{
|
|
DdlFlete.DataSource = ObjCGame.DtResultados.FiltraParametros("Peso IS NULL");
|
|
}
|
|
else
|
|
{
|
|
DdlFlete.DataSource = ObjCGame.DtResultados.FiltraParametros(String.Format("Peso IS NULL OR CveFlete = {0}", CveFlete));
|
|
}
|
|
}
|
|
|
|
ObjCGame.Dispose();
|
|
}
|
|
DdlFlete.Items.Insert(0, new ListItem("Seleccione", "-1"));
|
|
DdlFlete.DataBind();
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Limpia Modal
|
|
protected void LimpiaCorte()
|
|
{
|
|
TxtFecha.Text = DateTime.Now.ToString();
|
|
TxtPeso.Text = "";
|
|
DdlOrdenCorte.SelectedIndex = 0;
|
|
TxtObservacion.Text = "";
|
|
TxtModalAdjuntoArchivo.Text = "";
|
|
TxtTicketBascula.Text = "";
|
|
TxtPesoMerma.Text = "";
|
|
DdlMotivo.SelectedIndex = 0;
|
|
DdlFlete.SelectedIndex = 0;
|
|
DdlEmpaque.SelectedIndex = 0;
|
|
UPModalCort.Update();
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
#region Botones
|
|
protected void LnkEditarCort_Click(object sender, EventArgs e)
|
|
{
|
|
LimpiaCorte();
|
|
GridViewRow gvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
|
CveCorte = gvRow.DataKey("CveCorte").ToEntero();
|
|
Index = gvRow.RowIndex;
|
|
CargaOrdenCorte(gvRow.DataKey("CveOrdenCorte").ToEntero());
|
|
DdlOrdenCorte.SelectedValueExist(gvRow.DataKey("CveOrdenCorte").ToEntero());
|
|
TxtFecha.Text = gvRow.DataKey("Fecha");
|
|
TxtPeso.Text = gvRow.DataKey("Peso");
|
|
TxtObservacion.Text = gvRow.DataKey("Observacion");
|
|
TxtTicketBascula.Text = gvRow.DataKey("TicketBascula");
|
|
Adjunto = gvRow.DataKey("Adjunto");
|
|
TxtPesoMerma.Text = gvRow.DataKey("PesoMerma");
|
|
TxtModalAdjuntoArchivo.Text = "";
|
|
DdlMotivo.SelectedValueExist(gvRow.DataKey("CveMotivo").ToEntero());
|
|
CargaFletes(gvRow.DataKey("CveFlete").ToEntero());
|
|
DdlFlete.SelectedValueExist(gvRow.DataKey("CveFlete").ToEntero());
|
|
DdlEmpaque.SelectedValueExist(gvRow.DataKey("CveEmpaque").ToEntero());
|
|
if (gvRow.DataKey("Adjunto").ToString() != "") { LnkDescargar.Visible = true; }
|
|
RegistraScript("$('#DModalCorte').modal();");
|
|
BtnCortADD.Visible = false;
|
|
BtnCortEdit.Visible = true;
|
|
UPModalCort.Update();
|
|
}
|
|
protected void LnkAgregarCort_Click(object sender, EventArgs e)
|
|
{
|
|
Agregar();
|
|
}
|
|
|
|
protected void Agregar()
|
|
{
|
|
RegistraScript("$('#DModalCorte').modal();");
|
|
LimpiaCorte();
|
|
if (CveOrdenCorte > 0) { DdlOrdenCorte.SelectedValueExist(CveOrdenCorte); }
|
|
BtnCortADD.Visible = true;
|
|
BtnCortEdit.Visible = false;
|
|
LnkDescargar.Visible = false;
|
|
UPModalCort.Update();
|
|
}
|
|
protected void LnkAgregarBitacora_Click(object sender, EventArgs e)
|
|
{
|
|
RegistraScript("$('#DModalBitacora').modal();");
|
|
TxtComentario.Text = "";
|
|
UpModalBitacora.Update();
|
|
}
|
|
protected void BtnCortADD_Click(object sender, EventArgs e)
|
|
{
|
|
if (Valida())
|
|
{
|
|
String Adjunto = "";
|
|
if (TxtModalAdjuntoArchivo.getfiles().Archivos.Count > 0)
|
|
{
|
|
Archivo ArchivoAdjunto = TxtModalAdjuntoArchivo.getfiles().Archivos[0];
|
|
Adjunto = DdlOrdenCorte.SelectedValue + "_" + ArchivoAdjunto.filenameO;
|
|
}
|
|
ClsCGame ObjCort = new ClsCGame();
|
|
ObjCort.IniciaTransacSQL();
|
|
bool Continuar = ObjCort.AddCorte(TxtFecha.Text.ToDate(), TxtPeso.Text.ToDouble(), TxtObservacion.Text, Adjunto, TxtTicketBascula.Text, TxtPesoMerma.Text.ToDouble(), DdlMotivo.SelectedValue.ToEntero(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlOrdenCorte.SelectedValue.ToEntero(), DdlEmpaque.SelectedValue.ToEntero(), DdlFlete.SelectedValue.ToEntero());
|
|
Continuar = ObjCort.UpdateFleteImporte(DdlOrdenCorte.SelectedValue.ToEntero(), TxtPeso.Text.ToDouble(), DdlFlete.SelectedValue.ToEntero());
|
|
if (Continuar)
|
|
{
|
|
CveCorte = ObjCort.CveCorte;
|
|
ObjCort.Commit();
|
|
if (TxtModalAdjuntoArchivo.getfiles().Archivos.Count > 0)
|
|
{
|
|
GuardarAdjunto();
|
|
}
|
|
RegistraScript("$('#DModalCorte').modal('hide');");
|
|
if (CveOrdenCorte > 0)
|
|
{
|
|
Alert("La entrada de materia prima se ha agregado correctamente", TipoMensaje.MsgInformacion, $"document.location.href=\"/CGame/RepOrdenCorteDetalle.aspx?CveOrdenCorte={CveOrdenCorte}\"");
|
|
}
|
|
else
|
|
{
|
|
CargaCorte();
|
|
Alert("La entrada de materia prima se ha agregado correctamente");
|
|
}
|
|
}
|
|
else
|
|
{
|
|
ObjCort.RollBack();
|
|
}
|
|
ObjCort.Dispose();
|
|
UPModalCort.Update();
|
|
|
|
}
|
|
}
|
|
protected void BtnCortEdit_Click(object sender, EventArgs e)
|
|
{
|
|
if (Valida())
|
|
{
|
|
if (TxtModalAdjuntoArchivo.getfiles().Archivos.Count > 0)
|
|
{
|
|
Archivo ArchivoAdjunto = TxtModalAdjuntoArchivo.getfiles().Archivos[0];
|
|
Adjunto = DdlOrdenCorte.SelectedValue + "_" + ArchivoAdjunto.filenameO;
|
|
}
|
|
|
|
ClsCGame ObjCort = new ClsCGame();
|
|
ObjCort.IniciaTransacSQL();
|
|
bool Continuar = ObjCort.UpdateCorte(CveCorte, TxtFecha.Text.ToDate(), TxtPeso.Text.ToDouble(), TxtObservacion.Text, Adjunto, TxtTicketBascula.Text, TxtPesoMerma.Text.ToDouble(), DdlMotivo.SelectedValue.ToEntero(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlOrdenCorte.SelectedValue.ToEntero(), DdlEmpaque.SelectedValue.ToEntero(), DdlFlete.SelectedValue.ToEntero());
|
|
Continuar = ObjCort.UpdateFleteImporte(DdlOrdenCorte.SelectedValue.ToEntero(), TxtPeso.Text.ToDouble(), DdlFlete.SelectedValue.ToEntero());
|
|
if (Continuar)
|
|
{
|
|
ObjCort.Commit();
|
|
if (TxtModalAdjuntoArchivo.getfiles().Archivos.Count > 0)
|
|
{
|
|
GuardarAdjunto();
|
|
}
|
|
RegistraScript("$('#DModalCorte').modal('hide');");
|
|
CargaCorte();
|
|
Alert("La entrada de materia prima se ha actualizado correctamente");
|
|
}
|
|
else
|
|
{
|
|
ObjCort.RollBack();
|
|
}
|
|
ObjCort.Dispose();
|
|
UPModalCort.Update();
|
|
}
|
|
}
|
|
|
|
protected void LnkEliminarCort_Click(object sender, EventArgs e)
|
|
{
|
|
GridViewRow gvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
|
CveCorte = gvRow.DataKey("CveCorte").ToEntero();
|
|
ClsCGame ObjCort = new ClsCGame();
|
|
bool Continuar = ObjCort.RemoveCorte(CveCorte);
|
|
ObjCort.Dispose();
|
|
if (Continuar)
|
|
{
|
|
CargaCorte();
|
|
Alert("La entrada de materia prima ha eliminada");
|
|
}
|
|
}
|
|
|
|
protected void LnkDescargar_Click(object sender, EventArgs e)
|
|
{
|
|
string filename = GVCorte.Rows[Index].DataKey("Adjunto").ToString();
|
|
|
|
if (!String.IsNullOrEmpty(filename))
|
|
{
|
|
String rutaAplicacion = HttpContext.Current.Server.MapPath(HttpContext.Current.Request.ApplicationPath);
|
|
|
|
String Path = String.Format("{0}\\{1}", UsuarioActual.Empresa.Ruta, "AdjuntosCortes");
|
|
String ArchivoDestino = String.Format("{0}\\{1}", Path, GVCorte.Rows[Index].DataKey("Adjunto").ToString());
|
|
System.IO.FileInfo toDownload =
|
|
new System.IO.FileInfo(ArchivoDestino);
|
|
if (toDownload.Exists)
|
|
{
|
|
Response.ClearContent();
|
|
Response.ClearHeaders();
|
|
Response.AddHeader("Content-Disposition", "attachment; filename=" + filename);
|
|
Response.ContentType = "application/octet-stream";
|
|
Response.WriteFile(ArchivoDestino);
|
|
Response.Flush();
|
|
Response.Close();
|
|
Response.End();
|
|
HttpContext.Current.ApplicationInstance.CompleteRequest();
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
protected void BtnAddBitacora_Click(object sender, EventArgs e)
|
|
{
|
|
ClsCGame ObjCGame = new ClsCGame();
|
|
if (ObjCGame.AddBitacora(TxtComentario.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
|
|
{
|
|
Alert("La bitacora fue agregada correctamente");
|
|
}
|
|
ObjCGame.Dispose();
|
|
RegistraScript("$('#DModalBitacora').modal('hide');");
|
|
CargaBitacora();
|
|
}
|
|
|
|
|
|
protected void LnkPDF_Click(object sender, EventArgs e)
|
|
{
|
|
GridViewRow gvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
|
CveCorte = gvRow.DataKey("CveCorte").ToEntero();
|
|
GeneraPDF();
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
#region AutopostBack
|
|
|
|
//protected void DdlClasificacion_SelectedIndexChanged(object sender, EventArgs e)
|
|
//{
|
|
// CargaPS();
|
|
//}
|
|
|
|
//protected void DdlTransportista_SelectedIndexChanged(object sender, EventArgs e)
|
|
//{
|
|
// CargaChofer();
|
|
//}
|
|
|
|
protected void DdlOrdenCorte_SelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
CargaFletes();
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
#region Validacion
|
|
|
|
public bool Valida()
|
|
{
|
|
if (DdlOrdenCorte.SelectedValue == "-2")
|
|
{
|
|
Alert("Tiene que seleccionar una orden de corte", ModExtensiones.TipoMensaje.MsgAdvertencia);
|
|
return false;
|
|
}
|
|
if (DdlMotivo.SelectedValue == "-1")
|
|
{
|
|
Alert("Tiene que seleccionar un motivo", ModExtensiones.TipoMensaje.MsgAdvertencia);
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region GridView
|
|
|
|
protected void GvCorte_RowDataBound(object sender, GridViewRowEventArgs e)
|
|
{
|
|
if (e.Row.RowType == DataControlRowType.DataRow)
|
|
{
|
|
if (e.Row.RowIndex == 0)
|
|
{
|
|
e.Row.Cells[0].Text = "Total";
|
|
e.Row.CssClass = "Totales";
|
|
}
|
|
else
|
|
{
|
|
LinkButton lb = e.Row.FindControl("LnkPDF") as LinkButton;
|
|
ScriptManager.GetCurrent(this).RegisterPostBackControl(lb);
|
|
|
|
if (e.Row.FCLabel("lblResultadoEmpaque").Text == "")
|
|
{
|
|
e.Row.FCLabel("lblResultadoEmpaque").Text = "Sin Asignar";
|
|
}
|
|
else
|
|
{
|
|
String Css = "Texto";
|
|
String Liga = $"/CGame/Empaque.aspx?&CveProduccion={e.Row.DataKey("CveProduccion")}";
|
|
e.Row.FCLabel("lblResultadoEmpaque").Text = "<a class=" + "" + Css + "" + " href=" + "" + Liga + "" + ">" + e.Row.FCLabel("lblResultadoEmpaque").Text + "</a>";
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Adjunto
|
|
|
|
protected void GuardarAdjunto()
|
|
{
|
|
if (TxtModalAdjuntoArchivo.getfiles().Archivos.Count < 1)
|
|
{
|
|
return;
|
|
}
|
|
Archivo ArchivoAdjunto = TxtModalAdjuntoArchivo.getfiles().Archivos[0];
|
|
if (ArchivoAdjunto.filenameO.Length > 114)
|
|
{
|
|
Alert("El nombre del archivo excede los 115 caracteres permitidos. Por favor rectifique y vuelva a intentar.", ModExtensiones.TipoMensaje.MsgAdvertencia);
|
|
return;
|
|
}
|
|
try
|
|
{
|
|
String Path = String.Format("{0}\\{1}", UsuarioActual.Empresa.Ruta, "AdjuntosCortes");
|
|
ModExtensiones.DirectoryExistsCreate(ref Path);
|
|
String ArchivoDestino = String.Format("{0}\\{1}_{2}", Path, DdlOrdenCorte.SelectedValue, ArchivoAdjunto.filenameO);
|
|
if (System.IO.File.Exists(ArchivoDestino))
|
|
{
|
|
System.IO.File.Delete(ArchivoDestino);
|
|
}
|
|
System.IO.File.Move(ArchivoAdjunto.FileUrl, ArchivoDestino);
|
|
}
|
|
catch (Exception)
|
|
{
|
|
Alert("Ocurrió un error al guardar el archivo Adjunto. Por favor vuelva a intentar.", TipoMensaje.MsgError);
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Consulta
|
|
protected void BtnConsultar_Click(object sender, EventArgs e)
|
|
{
|
|
CargaCorte();
|
|
}
|
|
#endregion
|
|
|
|
#region PDF
|
|
|
|
private void GeneraPDF()
|
|
{
|
|
ClsCGame ObjCGame = new ClsCGame();
|
|
DataTable Dt = new DataTable();
|
|
if (ObjCGame.GetCorte(UsuarioActual.CveEmpresa, CveCorte: CveCorte))
|
|
{
|
|
Dt = ObjCGame.DtResultados;
|
|
if (Dt.Rows.Count > 0)
|
|
{
|
|
System.IO.FileInfo Imagen = new System.IO.FileInfo($"{UsuarioActual.Empresa.Ruta}/Logo.png");
|
|
String logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa);
|
|
List<ReportParameter> para = new List<ReportParameter>();
|
|
para.Add(new ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa));
|
|
para.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Nombre));
|
|
para.Add(new ReportParameter("FechaImpresion", DateTime.Now.ToString()));
|
|
para.Add(new ReportParameter("FolioOC",Dt.Rows[0]["FolioOC"].ToString()));
|
|
para.Add(new ReportParameter("TicketBascula", Dt.Rows[0]["TicketBascula"].ToString()));
|
|
para.Add(new ReportParameter("Peso", Dt.Rows[0]["Peso"].ToString().FormatoNumero()));
|
|
para.Add(new ReportParameter("PesoMerma", Dt.Rows[0]["PesoMerma"].ToString().FormatoNumero()));
|
|
para.Add(new ReportParameter("MotivoMerma", Dt.Rows[0]["Motivo"].ToString()));
|
|
para.Add(new ReportParameter("Empaque", Dt.Rows[0]["Empaque"].ToString()));
|
|
para.Add(new ReportParameter("Importe", Dt.Rows[0]["ImporteEmpaque"].ToString().FormatoNumero()));
|
|
para.Add(new ReportParameter("Observaciones", Dt.Rows[0]["Observacion"].ToString()));
|
|
para.Add(new ReportParameter("Fecha", Dt.Rows[0]["Fecha"].ToDate().ToShortDateString()));
|
|
|
|
if (Imagen.Exists)
|
|
{
|
|
para.Add(new ReportParameter("LogoPath", logouri));
|
|
}
|
|
else
|
|
{
|
|
para.Add(new ReportParameter("LogoPath", ""));
|
|
}
|
|
ImprimirPDF("Empresas/Grales/Formatos/EntradaMateriaPrima.rdlc", Dt, para, "Reporte de Entrada de Materia Prima");
|
|
}
|
|
else
|
|
{
|
|
Alert("No se encontraron datos");
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
}
|