This commit is contained in:
@@ -3,17 +3,55 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls;
|
||||
using Extensiones;
|
||||
|
||||
public partial class Ventas_RepConciliacionSat : ClsPaginas
|
||||
{
|
||||
const string rqFechaInicio = "FechaInicio";
|
||||
const string rqFechaFin = "FechaFin";
|
||||
public string RfechaI
|
||||
{
|
||||
get
|
||||
{
|
||||
return ViewState["RfechaI"].ToString();
|
||||
}
|
||||
set { ViewState["RfechaI"] = value; }
|
||||
}
|
||||
public string RfechaF
|
||||
{
|
||||
get
|
||||
{
|
||||
return ViewState["RfechaF"].ToString();
|
||||
}
|
||||
set { ViewState["RfechaF"] = value; }
|
||||
}
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
|
||||
//CrystalDecisions.CrystalReports.Engine.ReportDocument cryRpt = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
|
||||
//cryRpt.Load(String.Format("C:\\Proyectos\\wwwSIG\\Empresas\\Grales\\Formatos\\CatPS.rpt", UsuarioActual.Empresa.Ruta));
|
||||
//System.Data.DataTable DtDatos = new System.Data.DataTable();
|
||||
//using (ClsProductosServicios ObjPS = new ClsProductosServicios())
|
||||
//{
|
||||
// if (ObjPS.GetPSLite(-1, 119, "-1", "-1", "02541", -1, -1, -1, -1))
|
||||
// {
|
||||
// DtDatos = ObjPS.DtResultados;
|
||||
|
||||
// }
|
||||
//}
|
||||
//cryRpt.SetDataSource(DtDatos);
|
||||
//CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo coninfo = new CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo();
|
||||
//cryRpt.
|
||||
////cryRpt.SetDatabaseLogon("JCaudillo", "JCau127*953");// 293357
|
||||
//reports.ReportSource = cryRpt;
|
||||
//reports.RefreshReport();
|
||||
//// reports.Refresh();
|
||||
|
||||
|
||||
|
||||
DateTime fecha;
|
||||
DateTime fechaInicio = DateTime.Now;
|
||||
DateTime fechaFin = DateTime.Now;
|
||||
@@ -33,10 +71,10 @@ public partial class Ventas_RepConciliacionSat : ClsPaginas
|
||||
|
||||
protected void CargaRepConciliacionSatGET()
|
||||
{
|
||||
string RtipoDocto, RfechaI, RfechaF;
|
||||
string RtipoDocto;
|
||||
RtipoDocto = "I";
|
||||
RfechaI = txtFechaI.Text.ToDateTime().ToString();
|
||||
RfechaF = txtFechaF.Text.ToDateTime().ToString();
|
||||
RfechaI = txtFechaI.Text.Length > 0 ? txtFechaI.Text.ToDateTime().ToString("yyyy/MM/dd") : "";
|
||||
RfechaF = txtFechaF.Text.Length > 0 ? txtFechaF.Text.ToDateTime().ToString("yyyy/MM/dd") : "";
|
||||
using (ClsGenerales ObjRepC = new ClsGenerales())
|
||||
{
|
||||
ObjRepC.RepConciliacionSatGET(UsuarioActual.CveEmpresa, RtipoDocto, RfechaI, RfechaF);
|
||||
@@ -55,11 +93,65 @@ public partial class Ventas_RepConciliacionSat : ClsPaginas
|
||||
|
||||
protected void GVRepConciliacionSatGET_RowDataBound(object sender, GridViewRowEventArgs e)
|
||||
{
|
||||
if(e.Row.RowType == DataControlRowType.DataRow)
|
||||
if (e.Row.RowType == DataControlRowType.DataRow)
|
||||
{
|
||||
e.Row.CssClass = string.Format("Grupo{0}", e.Row.DBCampo("GRUPOCve"));
|
||||
string fechaI = RfechaI;
|
||||
string fechaF = RfechaF;
|
||||
DateTime danio;
|
||||
DateTime danioF;
|
||||
int GRUPOCve = e.Row.DBCampo("GRUPOCve").ToString().ToEntero();
|
||||
e.Row.CssClass = string.Format("Grupo{0}", GRUPOCve);
|
||||
e.Row.Attributes.Add("ganio", string.Format("{0}", e.Row.DBCampo("anio")));
|
||||
e.Row.Attributes.Add("gMes", string.Format("{0}", e.Row.DBCampo("Mes")));
|
||||
e.Row.Attributes.Add("gMes", string.Format("{0}", e.Row.DBCampo("Mes")));
|
||||
string navigateurl = "";
|
||||
switch (GRUPOCve)
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
danio = string.Format("{0}/01/01", e.Row.DBCampo("anio")).ToDateTime();
|
||||
danioF = danio.AddYears(1).AddSeconds(-1);
|
||||
if (RfechaI.ToDateTime() < danio)
|
||||
{
|
||||
fechaI = danio.ToString("yyyy/MM/dd");
|
||||
}
|
||||
if (RfechaF.ToDateTime() > danioF || RfechaF.Length == 0)
|
||||
{
|
||||
fechaF = danioF.ToString("yyyy/MM/dd HH:mm:ss");
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
danio = string.Format("{0}/{1}/01", e.Row.DBCampo("anio"), e.Row.DBCampo("Mes").Substring(4)).ToDateTime();
|
||||
danioF = danio.AddMonths(1).AddSeconds(-1);
|
||||
if (RfechaI.ToDateTime() < danio)
|
||||
{
|
||||
fechaI = danio.ToString("yyyy/MM/dd");
|
||||
}
|
||||
if (RfechaF.ToDateTime() > danioF || RfechaF.Length == 0)
|
||||
{
|
||||
fechaF = danioF.ToString("yyyy/MM/dd HH:mm:ss");
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
danio = string.Format("{0:yyyy/MM/dd}", e.Row.DBCampo("dia")).ToDateTime();
|
||||
danioF = danio.AddDays(1).AddSeconds(-1);
|
||||
if (RfechaI.ToDateTime() < danio)
|
||||
{
|
||||
fechaI = danio.ToString("yyyy/MM/dd");
|
||||
}
|
||||
if (RfechaF.ToDateTime() > danioF || RfechaF.Length == 0)
|
||||
{
|
||||
fechaF = danioF.ToString("yyyy/MM/dd HH:mm:ss");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
navigateurl = string.Format("{0}&{3}={1}&{4}={2}", navigateurl, fechaI, fechaF, rqFechaInicio, rqFechaFin);
|
||||
e.Row.FCHyperLink("HypSIG").NavigateUrl = string.Format("/Ventas/RepConciliacionEmitidosSat.aspx?RegistroEn=1{0}", navigateurl);
|
||||
e.Row.FCHyperLink("HypSAT").NavigateUrl = string.Format("/Ventas/RepConciliacionEmitidosSat.aspx?RegistroEn=2{0}", navigateurl);
|
||||
e.Row.FCHyperLink("HypSIGnoSAT").NavigateUrl = string.Format("/Ventas/RepConciliacionEmitidosSat.aspx?RegistroEn=3{0}", navigateurl);
|
||||
e.Row.FCHyperLink("HypSatnoSIG").NavigateUrl = string.Format("/Ventas/RepConciliacionEmitidosSat.aspx?RegistroEn=4{0}", navigateurl);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user