protected void ASPxButton1_Click(object sender, EventArgs e)
    {
        var exportOptions = new XlsxExportOptionsEx();

        exportOptions.CustomizeCell += exportOptions_CustomizeCell;
        ASPxGridViewExporter1.WriteXlsxToResponse(exportOptions);
    }
Exemple #2
0
        protected void AspxMenuItem1(object source, DevExpress.Web.MenuItemEventArgs e)
        {
            try
            {
                switch (e.Item.Name)
                {
                case "btnUpdate":
                    ASPxPopupControl1.ShowOnPageLoad = true;
                    break;

                case "btnFind":
                    LoadGridView(Convert.ToInt32(ASPxSpinEdit2.Number));
                    break;

                case "btnReport":
                    ReportView();
                    ASPxPopupControl2.ShowOnPageLoad = true;
                    break;

                case "btnRefresh":
                    LoadGridView(Convert.ToInt32(Session["IDINCOME"]));
                    break;

                case "btnExcel":
                    ASPxGridViewExporter1.WriteXlsxToResponse();
                    break;
                }
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true);
            }
        }
Exemple #3
0
        protected void ASpxMenu1_ItemClick(object source, MenuItemEventArgs e)
        {
            try
            {
                switch (e.Item.Name)
                {
                case "btnReport":
                    ASPxPopupControl2.ShowOnPageLoad = true;
                    ReportView();
                    break;

                case "btnRefresh":
                    LoadGridView(Convert.ToInt32(Session["IDINCOME"]));
                    break;

                case "btnBill":
                    ValidarPickinFacturacion();
                    break;

                case "btnExcel":
                    ASPxGridViewExporter1.WriteXlsxToResponse();
                    break;
                }
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true);
            }
        }
Exemple #4
0
        protected void ASPxMenu1_ItemClick(object source, DevExpress.Web.MenuItemEventArgs e)
        {
            if (!ValidarConexionYUsuarioLogueado(source))
            {
                return;
            }
            try
            {
                switch (e.Item.Name)
                {
                case "btnReport":
                    ReportView();
                    ASPxPopupControl1.ShowOnPageLoad = true;
                    break;

                case "btnExcel":
                    ASPxGridViewExporter1.WriteXlsxToResponse();
                    break;

                case "btnRefresh":
                    GetStatusInventory();
                    break;
                }
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true);
            }
        }
        protected void AspxMenu1_ItemClick(object source, DevExpress.Web.MenuItemEventArgs e)
        {
            switch (e.Item.Name)
            {
            case "btnNew":
                Session["GridManifiesto"] = null;
                ASPxGridView2.DataSource  = null;
                ASPxGridView2.DataBind();
                GetPicking();
                break;

            case "btnExcel":
                ASPxGridViewExporter1.WriteXlsxToResponse();
                break;

            case "btnPdf":
                ASPxGridViewExporter1.Landscape = true;
                ASPxGridViewExporter1.WritePdfToResponse();
                break;

            case "btnReport":
                ReportViewer();
                ASPxPopupControl1.ShowOnPageLoad = true;
                break;
            }
        }
Exemple #6
0
        protected void AspxMenu1_itemClick(object source, DevExpress.Web.MenuItemEventArgs e)
        {
            try
            {
                switch (e.Item.Name)
                {
                case "btnReport":
                    ReportView();
                    ASPxPopupControl1.ShowOnPageLoad = true;
                    break;

                case "btnExcel":
                    ASPxGridViewExporter1.WriteXlsxToResponse();
                    break;

                case "btnFind":
                    GetLocationInventory(ASPxDateEdit2.Date, ASPxDateEdit1.Date);
                    break;

                case "btnCheck":
                    GetHistSku();
                    break;
                }
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true);
            }
        }
        protected void AspxMenu1_itemClick(object source, DevExpress.Web.MenuItemEventArgs e)
        {
            switch (e.Item.Name)
            {
            case "btnFind":
                DataSet ds;
                try
                {
                    var pResult = "";
                    ds = _objTask.GetAllTask(Session["connectionString"].ToString(), ASPxDateEdit2.Date, ASPxDateEdit1.Date, ref pResult);
                    if (pResult == "")
                    {
                        Session["DATA_TASK"]     = ds;
                        ASPxGridView1.DataSource = ds;
                        ASPxGridView1.DataBind();
                    }
                    else
                    {
                        ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('" + pResult + "');", true);
                    }
                }
                catch (Exception ex)
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true);
                }
                break;

            case "btnReport":
                ReportView();
                ASPxPopupControl1.ShowOnPageLoad = true;
                break;

            case "btnExcel":
                ASPxGridViewExporter1.WriteXlsxToResponse();
                break;

            case "btnAll":
                try
                {
                    var pResult = "";
                    ds = _objTask.GetAllTaskToday(Session["connectionString"].ToString(), ref pResult);
                    if (pResult == "")
                    {
                        Session["DATA_TASK"]     = ds;
                        ASPxGridView1.DataSource = ds;
                        ASPxGridView1.DataBind();
                    }
                    else
                    {
                        ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('" + pResult + "');", true);
                    }
                }
                catch (Exception ex)
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true);
                }
                break;
            }
        }
        protected void Excell(object sender, EventArgs e)
        {
            ASPxGridViewExporter1.WriteXlsxToResponse("kontrolka - " + DateTime.Now.ToShortDateString());

            /*ASPxGridViewExporter1.DataBind();
             * Session["exporter"] = ASPxGridViewExporter1;
             * ScriptManager.RegisterStartupScript(Page, Page.GetType(), "print2", "JavaScript:window.open('kontrolkaExcell.aspx')", true);
             */
        }
        protected void AspxMenu1_ItemClick(object source, DevExpress.Web.MenuItemEventArgs e)
        {
            try
            {
                switch (e.Item.Name)
                {
                case "btnFind":
                    try
                    {
                        if (Convert.ToDateTime(ASPxDateEdit1.Date) > Convert.ToDateTime(ASPxDateEdit2.Date))
                        {
                            ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('La fecha de inicio debe de ser menor a la final.');", true);
                            break;
                        }
                        var pResult = "";
                        var ds      = _objPicking.GetAllPicking(Session["connectionString"].ToString(), Convert.ToDateTime(ASPxDateEdit1.Date), Convert.ToDateTime(ASPxDateEdit2.Date), ref pResult);
                        if (pResult == "")
                        {
                            Session["datosPicking"] = ds;
                            if (ds.Tables[0].Rows.Count > 0)
                            {
                                ASPxGridView1.DataSource = ds;
                                ASPxGridView1.DataBind();
                                //LoadOperator();
                                //LoadClient();
                            }
                        }
                        else
                        {
                            ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('" + pResult + "');", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError(Error: '" + ex.Message + "');", true);
                    }
                    break;

                case "btnReport":
                    ReportView();
                    ASPxPopupControl1.ShowOnPageLoad = true;
                    break;

                case "btnExcel":
                    ASPxGridViewExporter1.WriteXlsxToResponse();
                    break;
                }
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true);
            }
        }
Exemple #10
0
        protected void ASPxMenu1_ItemClick(object source, DevExpress.Web.MenuItemEventArgs e)
        {
            if (!ValidarConexionYUsuarioLogueado(source))
            {
                return;
            }
            try
            {
                switch (e.Item.Name)
                {
                case "UiBotonGenerarReporte":
                    GenerarReporte();
                    ASPxPopupControl5.ShowOnPageLoad = true;
                    break;

                case "btnExcel":
                    ASPxGridViewExporter1.WriteXlsxToResponse();
                    break;

                case "btnGeo":

                    ObtnerRegistrosFiltrados();

                    switch (rblPuntos.SelectedItem.Value.ToString())
                    {
                    case "Facturas":
                        ActualizaListaPuntosFacturacion(1, 0);
                        break;

                    case "Clientes":
                        ActualizaListaPuntosFacturacion(0, 1);
                        break;

                    default:
                        ActualizaListaPuntosFacturacion(1, 1);
                        break;
                    }

                    PopupPoligonos.ShowOnPageLoad = true;

                    break;
                }
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true);
            }
        }
 protected void ASPxMenu1_ItemClick(object source, DevExpress.Web.MenuItemEventArgs e)
 {
     switch (e.Item.Name)
     {
     case "btnExcel":
         try
         {
             ASPxGridViewExporter1.WriteXlsxToResponse();
         }
         catch (Exception ex)
         {
             ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true);
         }
         break;
     }
 }
Exemple #12
0
        protected void ASPxMenu1_ItemClick(object source, DevExpress.Web.MenuItemEventArgs e)
        {
            if (ValidarConexionYUsuarioLogueado(source))
            {
                switch (e.Item.Name)
                {
                case "btnExcel":
                    ASPxGridViewExporter1.WriteXlsxToResponse();
                    break;

                case "btnReport":
                    ReportView();
                    ASPxPopupControl5.ShowOnPageLoad = true;
                    break;
                }
            }
        }
        protected void GridMenu_ItemClick(object source, DevExpress.Web.MenuItemEventArgs e)
        {
            try
            {
                switch (e.Item.Name)
                {
                case "btnExcel":
                    ASPxGridViewExporter1.WriteXlsxToResponse();
                    break;

                case "btnReport":
                    ASPxPopupControl5.ShowOnPageLoad = true;
                    GenerarReporte();
                    break;
                }
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true);
            }
        }
Exemple #14
0
        protected void ASPxMenu1_ItemClick(object source, DevExpress.Web.MenuItemEventArgs e)
        {
            if (!ValidarConexionYUsuarioLogueado(source))
            {
                return;
            }
            switch (e.Item.Name)
            {
            case "btnExcel":
                ASPxGridViewExporter1.WriteXlsxToResponse();
                break;

            case "btnRefresh":
                GetTasksByDate(ASPxCalendar1.SelectedDate);
                break;

            case "UiBotonReporte":
                ReportView();
                UiPopupReporte.ShowOnPageLoad = true;
                break;
            }
        }
        protected void AspxMenu1_itemClick(object source, DevExpress.Web.MenuItemEventArgs e)
        {
            switch (e.Item.Name)
            {
            case "btnFind":
                var pResult = "";
                try
                {
                    var ds = _objIncome.GetAllIncome(Session["connectionString"].ToString(), Convert.ToDateTime(ASPxDateEdit2.Date), Convert.ToDateTime(ASPxDateEdit1.Date), ref pResult);
                    if (pResult == "")
                    {
                        Session["DATA_RECEPTION"] = ds;
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            ASPxGridView1.DataSource = ds;
                            ASPxGridView1.DataBind();
                        }
                    }
                    else
                    {
                        ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError(" + pResult + "');", true);
                    }
                }
                catch (Exception ex)
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true);
                }
                break;

            case "btnReport":
                ReportView();
                ASPxPopupControl1.ShowOnPageLoad = true;
                break;

            case "btnExcel":
                ASPxGridViewExporter1.WriteXlsxToResponse();
                break;
            }
        }
        protected void ASPxMenu1_ItemClick(object source, DevExpress.Web.MenuItemEventArgs e)
        {
            if (ValidarConexionYUsuarioLogueado(new object()))
            {
                return;
            }

            switch (e.Item.Name)
            {
            case "btnExcel":
                ASPxGridViewExporter1.WriteXlsxToResponse();
                break;

            case "btnReport":
                GetSellerBySku();
                ReportViewer();
                PopupUiVisualizarReporte.ShowOnPageLoad = true;
                break;

            case "btnFrequent":
                //FrequentSKU();
                break;
            }
        }
Exemple #17
0
        protected void UiMenuOpciones_ItemClick(object source, DevExpress.Web.MenuItemEventArgs e)
        {
            if (ValidarConexionYUsuarioLogueado(source))
            {
                try
                {
                    switch (e.Item.Name)
                    {
                    case "btnExcel":
                        ASPxGridViewExporter1.WriteXlsxToResponse();
                        break;

                    case "btnReport":
                        //ReportViewer();
                        popConfDeletePortFolioAllDet.ShowOnPageLoad = true;
                        break;
                    }
                }
                catch (Exception ex)
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true);
                }
            }
        }
Exemple #18
0
 protected void btnXuat_Click(object sender, EventArgs e)
 {
     _DataBind();
     ASPxGridViewExporter1.DataBind();
     ASPxGridViewExporter1.WriteXlsxToResponse();
 }
Exemple #19
0
 protected void btnXlsExport_Click(object sender, EventArgs e)
 {
     ASPxGridViewExporter1.WriteXlsxToResponse("零件代码信息导出");
 }
        protected void ASPxMenu3_ItemClick(object source, DevExpress.Web.MenuItemEventArgs e)
        {
            switch (e.Item.Name)
            {
            case "btnSAP":
                try
                {
                    if (string.IsNullOrEmpty(Session["CODE_WAREHOUSE"].ToString()))
                    {
                        ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Ingrese la Bodega');", true);
                        return;
                    }
                    GetSku();
                    var dsSku = (DataSet)Session["PICKINGSKU"];


                    var ds = (DataSet)Session["SAP_PICKING_DATA"];
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        //VALIDAR SI EL SKU QUE VIENE DE SAP, EXISTE EN EL INVENTARIO
                        string validacion = ErpValidation(ds, dsSku);

                        if (validacion == "OK")
                        {
                            ASPxSpinEdit2.Text     = ds.Tables[0].Rows[0]["ERP_DOC"].ToString(); //ASPxTextBox4.Text;
                            ASPxSpinEdit2.ReadOnly = true;
                            ASPxSpinEdit3.Text     = ds.Tables[0].Rows[0]["ERP_DOC"].ToString(); //ASPxTextBox4.Text;
                            ASPxSpinEdit3.ReadOnly = true;

                            if (UiListaPedidosErp.Value != null)
                            {
                                switch (UiListaPedidosErp.Value.ToString().Split('|')[1])
                                {
                                case "SO":
                                    ASPxComboBox1.Value = "4";
                                    break;

                                case "IT":
                                    ASPxComboBox1.Value = "3";
                                    break;
                                }
                                ASPxComboBox1.Value    = ASPxComboBox1.SelectedItem.Value;
                                ASPxComboBox1.ReadOnly = true;
                            }

                            ASPxGridLookup1.Value = ds.Tables[0].Rows[0]["CUSTOMER_ID"].ToString();
                            //Session["UPDATE_TEMP"] = "false";


                            Session["INGRESO_HEADER_PICKING"] = "TRUE";
                            _result = _wscalled.InsertPickingTemp(Convert.ToString(ASPxComboBox1.Value),
                                                                  Convert.ToString(ASPxGridLookup1.Value), Convert.ToString(ASPxGridLookup2.Text),
                                                                  ASPxSpinEdit2.Text, ASPxSpinEdit3.Text, Session["USER"].ToString(),
                                                                  Session["connectionString"].ToString(), ASPxDateEdit1.Date,
                                                                  Convert.ToInt32(ASPxComboBox2.Value));

                            //datos del HEADER
                            var pResult  = "";
                            var dsNumber =
                                _wscalled.GetNumberHeaderPicking(Session["connectionString"].ToString(), ref pResult);
                            if (pResult == "")
                            {
                                Session["Header_picking"] =
                                    Convert.ToInt32(dsNumber.Tables[0].Rows[0]["PICKING_HEADER"]);

                                //INSERTAR EN TABLA TEMPORAL
                                for (int i = 0; ds.Tables[0].Rows.Count > i; i++)
                                {
                                    _wscalled.InsertPickingetail(
                                        Convert.ToInt32(dsNumber.Tables[0].Rows[0]["PICKING_HEADER"]),
                                        ds.Tables[0].Rows[i]["SKU"].ToString(),
                                        Convert.ToDecimal(ds.Tables[0].Rows[i]["QTY"]),
                                        Session["connectionString"].ToString(),
                                        ds.Tables[0].Rows[i]["SKU_DESCRIPTION"].ToString());
                                }
                                ASPxPageControl2.ActiveTabIndex = 0;
                                //OBTENER EL DETALLE ACTUALIZADO
                                var pResult2 = "";
                                var dsDetail =
                                    _wscalled.GetPickingDetailForPickingHeader((int)Session["Header_picking"],
                                                                               Session["connectionString"].ToString(), ref pResult2);
                                //LLENAR EL GRID
                                if (pResult2 == "")
                                {
                                    ASPxGridView1.DataSource = dsDetail;
                                    ASPxGridView1.DataBind();
                                    Session["dsPicking"] = dsDetail;
                                }
                                else
                                {
                                    ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('" + pResult2 + "');", true);
                                }
                                ASPxSpinEdit1.Number = 0;
                            }
                            else
                            {
                                ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('" + pResult + "');", true);
                            }
                            Session["SAP_PICKING_DATA"] = null;
                            ASPxGridView2.DataSource    = null;
                            ASPxGridView2.DataBind();
                            UiListaPedidosErp.Value            = null;//ASPxTextBox4.Text = "";
                            ASPxGridLookup3.Visible            = false;
                            ASPxSpinEdit1.Visible              = false;
                            ASPxLabel6.Visible                 = false;
                            ASPxLabel5.Visible                 = false;
                            ASPxGridView1.Columns["#"].Visible = false;
                            ASPxGridLookup1.ReadOnly           = true;
                            ASPxButton3.Visible                = false;

                            LlenarListaBodegas();

                            UiListaBodega.Enabled    = true;
                            UiListaBodegaErp.Enabled = true;

                            UiListaBodega.Value    = Session["CODE_WAREHOUSE"];
                            UiListaBodegaErp.Value = Session["CODE_WAREHOUSE"];

                            UiListaBodega.Enabled    = false;
                            UiListaBodegaErp.Enabled = false;
                        }
                        else
                        {
                            ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('" + validacion + "');", true);
                        }
                    }
                    else
                    {
                        ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('No hay datos en la referencia');", true);
                    }
                }

                catch (Exception)
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('No hay datos en la referencia');", true);
                }
                break;

            case "btnExcel":
                ASPxGridViewExporter1.WriteXlsxToResponse();
                break;

            case "btnReport":
                ReportView();
                ASPxPopupControl2.ShowOnPageLoad = true;
                break;
            }
        }
        protected void ASPxMenu1_ItemClick(object source, DevExpress.Web.MenuItemEventArgs e)
        {
            ValidarConexionYUsuarioLogueado(new object());
            switch (e.Item.Name)
            {
            case "btnFind":
                if (ASPxDateEdit2.Date >= ASPxDateEdit1.Date)
                {
                    GetOrders(ASPxDateEdit1.Date, ASPxDateEdit2.Date);
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: La fecha inicio no pude ser mayor a la fecha fin');", true);
                }
                break;

            case "btnExcel":
                ASPxGridViewExporter1.WriteXlsxToResponse();
                break;

            case "btnMap":
                try
                {
                    var dsmapa    = new DataSet();
                    var tablaMapa = new DataTable("MAPA");
                    tablaMapa.Columns.Add("ASSIGNED_TO");
                    tablaMapa.Columns.Add("Latitude");
                    tablaMapa.Columns.Add("Longitude");
                    tablaMapa.Columns.Add("ROUTE");
                    tablaMapa.Columns.Add("CLIENT");
                    tablaMapa.Columns.Add("TOTAL_AMOUNT");
                    dsmapa.Tables.Add(tablaMapa);
                    var fieldValues = ASPxGridView1.GetSelectedFieldValues("ASSIGNED_TO", "Latitude", "Longitude", "ROUTE", "CLIENT", "TOTAL_AMOUNT");
                    foreach (object[] value in fieldValues)
                    {
                        var row = dsmapa.Tables[0].NewRow();
                        row[0] = value[0];
                        row[1] = value[1];
                        row[2] = value[2];
                        row[3] = value[3];
                        row[4] = value[4];
                        row[5] = value[5];
                        dsmapa.Tables[0].Rows.Add(row);
                    }

                    Session["Routes"] = dsmapa;
                    ScriptManager.RegisterStartupScript(this, GetType(), "mapa", "popup();", true);
                }
                catch (Exception ex)
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true);
                }
                break;

            case "btnReport":
                ReportView();
                ASPxPopupControl1.ShowOnPageLoad = true;
                break;

            case "btnSend":
                ResetSendErp(source);
                break;
            }
        }
 protected void Export_ServerClick(object sender, EventArgs e)
 {
     ASPxGridViewExporter1.WriteXlsxToResponse("table1.xlsx", new XlsxExportOptionsEx {
         ExportType = ExportType.WYSIWYG
     });
 }
Exemple #23
0
 protected void ToExport(object sender, EventArgs e)
 {
     ASPxGridViewExporter1.WriteXlsxToResponse(YxBtn.Title);
 }
Exemple #24
0
 protected void ASPxButton1_Click(object sender, EventArgs e)
 {
     ASPxGridViewExporter1.WriteXlsxToResponse(new XlsxExportOptionsEx {
         ExportType = ExportType.WYSIWYG
     });
 }
Exemple #25
0
        protected void ASPxMenu2_ItemClick(object source, MenuItemEventArgs e)
        {
            switch (e.Item.Name)
            {
            case "btnSAP":
                try
                {
                    var ds = (DataSet)Session["SAP_RECEPTION_DATA"];
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        SpinSap.ReadOnly     = true;
                        CbType.SelectedIndex = 0;

                        if (Session["SAP_RECEPTION_TYPE"].ToString().Equals("IT"))
                        {
                            GetClassificationReception();
                            CbType.Value            = "RTR";
                            CbType.ReadOnly         = true;
                            GrLookProvider.ReadOnly = true;
                        }

                        LlenarListaPorTipo(ds.Tables[0].Rows[0]["PROVIDER_NAME"].ToString());
                        GrLookProvider.Text       = ds.Tables[0].Rows[0]["PROVIDER_NAME"].ToString();
                        Session["INGRESO_HEADER"] = "TRUE";
                        _cs = Session["connectionString"].ToString();
                        _wscalled.InsertIncomeTemp(Convert.ToString(CbType.Value), Convert.ToString(GrLookProvider.Value), Convert.ToString(GrLookUser.Text), TxtReference.Text, SpinSap.Text, Session["USER"].ToString(), Session["connectionString"].ToString(), DateAssignedDate.Date, Convert.ToInt32(CbPriority.Value));
                        //datos del HEADER
                        var dsNumber = _wscalled.GetNumberHeader(Session["connectionString"].ToString());
                        Session["Header"] = Convert.ToInt32(dsNumber.Tables[0].Rows[0]["RECEPTION_HEADER"]);

                        var erpReferences = string.Empty;
                        var comments      = string.Empty;
                        var erpDocs       = ds.Tables[0].DefaultView.ToTable(true, "ERP_DOC");
                        for (var i = 0; erpDocs.Rows.Count > i; i++)
                        {
                            erpReferences = erpReferences + ds.Tables[0].DefaultView.ToTable(true, "ERP_DOC").Rows[i]["ERP_DOC"] + ",";
                            var erpDoc  = erpDocs.Rows[i]["ERP_DOC"];
                            var comment = ds.Tables[0].Select(" ERP_DOC = '" + erpDoc + "'")[0]["COMMENTS"];
                            comments += erpDoc + ": " + comment + Environment.NewLine;
                        }
                        TxtReference.Text              = erpReferences.Substring(0, erpReferences.Length - 1);
                        LblErpReferences.Text          = "Referencias: " + erpReferences.Substring(0, erpReferences.Length - 1);
                        LblErpReferences.ClientVisible = true;
                        MemoComments.Text              = comments;
                        //MemoComments.Text = comments.Substring(0, comments.Length - 1);
                        //INSERTAR EN TABLA TEMPORAL
                        for (var i = 0; ds.Tables[0].Rows.Count > i; i++)
                        {
                            _wscalled.InsertIncomeDetail(Convert.ToInt32(dsNumber.Tables[0].Rows[0]["RECEPTION_HEADER"]), ds.Tables[0].Rows[i]["SKU"].ToString(), Convert.ToDecimal(ds.Tables[0].Rows[i]["QTY"]), Session["connectionString"].ToString(), ds.Tables[0].Rows[i]["SKU_DESCRIPTION"].ToString());
                        }


                        //ASPxPageControl1.ActiveTabIndex = 0;
                        //OBTENER EL DETALLE ACTUALIZADO
                        var pResult  = "";
                        var dsDetail = _wscalled.GetIncomeDetailForIncomeHeader((int)Session["Header"], Session["connectionString"].ToString(), ref pResult);
                        if (pResult == "")
                        {
                            //LLENAR EL GRID
                            GridReception.DataSource = dsDetail;
                            GridReception.DataBind();

                            SpinSku.Number         = 0;
                            Session["dsReception"] = dsDetail;
                        }
                        else
                        {
                            ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('" + pResult + "');", true);
                        }
                        ASPxPageControl1.ActiveTabPage = ASPxPageControl1.TabPages.FindByName("Manual");
                        //TxtErp.Text = "";
                        GrLookSku.Visible                  = false;
                        SpinSku.Visible                    = false;
                        ASPxLabel6.Visible                 = false;
                        ASPxLabel8.Visible                 = false;
                        GrLookProvider.ReadOnly            = true;
                        GridReception.Columns["#"].Visible = false;
                    }
                }
                catch (Exception ex)
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('No hay datos en la referencia');", true);
                }
                break;

            case "btnExcel":
                ASPxGridViewExporter1.WriteXlsxToResponse();
                break;

            case "btnReport":
                ReportView();
                ASPxPopupControl2.ShowOnPageLoad = true;
                break;
            }
        }