private void Reporte_Cargar() { List <gsDocVenta_ControlCosto_MarcaProductoResult> lstDocumentos; try { CierreCostoWCFClient objCierreCostoWCF = new CierreCostoWCFClient(); DateTime fechaInicio = new DateTime(dpFecInicio.SelectedDate.Value.Year, dpFecInicio.SelectedDate.Value.Month, 1); DateTime fechaFinal = new DateTime(dpFecFinal.SelectedDate.Value.Year, dpFecFinal.SelectedDate.Value.Month, 1).AddMonths(1).AddDays(-1); lstDocumentos = objCierreCostoWCF.DocVenta_ControlCosto_MarcaProducto(((Usuario_LoginResult)Session["Usuario"]).idEmpresa, ((Usuario_LoginResult)Session["Usuario"]).codigoUsuario, dpFecInicio.SelectedDate.Value, dpFecFinal.SelectedDate.Value, null).ToList(); grdDocumentos.DataSource = lstDocumentos; grdDocumentos.DataBind(); lblMensaje.Text = "Se han encontrado " + lstDocumentos.Count.ToString() + " registro."; lblMensaje.CssClass = "mensajeExito"; ViewState["lstDocumentos"] = JsonHelper.JsonSerializer(lstDocumentos); } catch (Exception ex) { throw ex; } }
private void Productos_Cargar() { CierreCostoWCFClient objCierreCostoWCF = new CierreCostoWCFClient(); List <gsDocVenta_ControlCosto_MarcaProductoResult> lstProductos; try { int periodo = int.Parse(cboPeriodo.SelectedValue); DateTime fechaInicio = new DateTime((periodo - periodo % 100) / 100, periodo % 100, 1); DateTime fechaFinal = fechaInicio.AddMonths(1).AddDays(-1); Usuario_LoginResult usuario = (Usuario_LoginResult)Session["Usuario"]; lstProductos = objCierreCostoWCF.DocVenta_ControlCosto_MarcaProducto(usuario.idEmpresa, usuario.codigoUsuario, fechaInicio, fechaFinal, null).ToList(); grdControlCostos.DataSource = lstProductos; grdControlCostos.DataBind(); ViewState["lstProductos"] = JsonHelper.JsonSerializer(lstProductos); ViewState["periodo"] = periodo; } catch (Exception ex) { throw ex; } }
protected void Page_Load(object sender, EventArgs e) { if (Session["Usuario"] == null) { Response.Redirect("~/Security/frmCerrar.aspx"); } try { if (!Page.IsPostBack) { LoginWCF.LoginWCFClient objLoginWCF = new LoginWCF.LoginWCFClient(); objLoginWCF.AuditoriaMenu_Registrar(System.Web.HttpContext.Current.Request.Url.AbsolutePath, Environment.MachineName, ((Usuario_LoginResult)System.Web.HttpContext.Current.Session["Usuario"]).idUsuario); Title = "Plan de producción del periodo " + Request.QueryString["periodo"]; CierreCostoWCFClient objCierreCostoWCF = new CierreCostoWCFClient(); int periodo = int.Parse(Request.QueryString["periodo"]); int kardex = int.Parse(Request.QueryString["kardex"]); DateTime fechaFinal = new DateTime((periodo - periodo % 100) / 100, periodo % 100, 1).AddMonths(1).AddDays(-1); DateTime fechaInicio = fechaFinal.AddMonths(-6).AddDays(1); rhcCostos.DataSource = objCierreCostoWCF.DocVenta_ControlCosto_MarcaProducto(((Usuario_LoginResult)Session["Usuario"]).idEmpresa, ((Usuario_LoginResult)Session["Usuario"]).codigoUsuario, fechaInicio, fechaFinal, kardex); rhcCostos.DataBind(); lblMensaje.Text = "Los datos han sido cargados correctamente."; lblMensaje.CssClass = "mensajeExito"; } } catch (Exception ex) { lblMensaje.Text = ex.Message; lblMensaje.CssClass = "mensajeError"; } }