Exemplo n.º 1
0
        public void ReportView()
        {
            try
            {
                if (Session["dsReporte"] != null)
                {
                    var dsDiseño    = new dsReception();
                    var dsEjecucion = (DataSet)Session["dsReporte"];

                    for (var i = 0; i < dsEjecucion.Tables[0].Rows.Count; i++)
                    {
                        var row = dsDiseño.SWIFT_RECEPTION_HEADER.NewRow();
                        row[0] = Convert.ToString(Session["IDINCOME"]);
                        row[1] = dsEjecucion.Tables[0].Rows[i]["NAME_CLASSIFICATION"];
                        row[2] = dsEjecucion.Tables[0].Rows[i]["NAME_PROVIDER"];
                        row[3] = dsEjecucion.Tables[0].Rows[i]["LOGIN"];
                        row[4] = dsEjecucion.Tables[0].Rows[i]["REFERENCE"];
                        row[5] = dsEjecucion.Tables[0].Rows[i]["DOC_SAP_RECEPTION"];
                        dsDiseño.SWIFT_RECEPTION_HEADER.Rows.Add(row);
                    }

                    for (var i = 0; i < dsEjecucion.Tables[1].Rows.Count; i++)
                    {
                        var row = dsDiseño.SWIFT_RECEPTION_DETAIL.NewRow();
                        row[0] = dsEjecucion.Tables[1].Rows[i]["CODE_SKU"];
                        row[1] = dsEjecucion.Tables[1].Rows[i]["DESCRIPTION_SKU"];
                        row[2] = dsEjecucion.Tables[1].Rows[i]["EXPECTED"];
                        row[3] = dsEjecucion.Tables[1].Rows[i]["RESULT"];
                        row[4] = dsEjecucion.Tables[1].Rows[i]["SCANNED"];
                        row[5] = dsEjecucion.Tables[1].Rows[i]["DIFFERENCE"];
                        dsDiseño.SWIFT_RECEPTION_DETAIL.Rows.Add(row);
                    }
                    var reporte = new Report.ReportReception {
                        DataSource = dsDiseño
                    };
                    Session["DSDISEÑO"]        = dsDiseño;
                    ASPxDocumentViewer1.Report = reporte;
                    ASPxDocumentViewer1.DataBind();
                }
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true);
            }
        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!ValidarConexionYUsuarioLogueado(sender))
            {
                return;
            }
            if (Session["connectionString"] == null || Session["USER"] == null)
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "Logoff", "LogOff();", true);
                //Response.Redirect("Login.aspx");
            }
            else
            {
                try
                {
                    var reporte = new Report.ReportReception {
                        DataSource = Session["DSDISEÑO"]
                    };
                    ASPxDocumentViewer1.Report = reporte;
                    ASPxDocumentViewer1.DataBind();
                    if (!Page.IsPostBack)
                    {
                        try
                        {
                            if (Request.QueryString["codigo"] == null)
                            {
                                _codeIncome = 0;
                                _estatus    = string.Empty;
                            }
                            else
                            {
                                _codeIncome          = Convert.ToInt32(Request.QueryString["codigo"]);
                                ASPxSpinEdit2.Number = _codeIncome;
                                _estatus             = Convert.ToString(Request.QueryString["ESTATUS"]);
                                if (_estatus == "CLOSED")
                                {
                                    ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Esta Recepcion ya se encuentra Finalizada');", true);
                                    ASPxMenu1.Items[0].Visible = false;
                                    ASPxCheckBox1.Enabled      = false;
                                    ASPxMemo1.ReadOnly         = true;
                                }
                            }
                        }
                        catch (Exception ex)
                        {
                            ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true);
                        }


                        GetClassificationReception(Session["connectionString"].ToString());
                        GetProvider(Session["connectionString"].ToString());
                        GetOperator(Session["connectionString"].ToString());
                        Session["IDINCOME"] = _codeIncome;
                    }
                    LoadGridView(Convert.ToInt32(Session["IDINCOME"]));
                }
                catch (Exception ex)
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true);
                }
            }
        }