public void GetDataHeader(string pickingHeader)
        {
            try
            {
                var pResult = "";
                var ds      = _objPicking.GePickingInPanelReception(Convert.ToInt32(pickingHeader), Session["connectionString"].ToString(), ref pResult);
                if (pResult == "")
                {
                    Session["DATOS_PICKING_DATASET"] = ds;
                    Session["DATOS_PICKING_DETAIL"]  = ds.Tables[1];
                    ASPxGridView3.DataSource         = ds.Tables[1];

                    ASPxGridView3.DataBind();
                    //AQUI VERIFICA SI LOS VALORES SON 0
                    int contador = 0;
                    foreach (DataRow row in ds.Tables[1].Rows) // Loop over the rows.
                    {
                        contador = Convert.ToInt32(row[6]) + contador;
                    }
                    if (contador == 0)
                    {
                        _objFreight.UpdatePickingHeaderFF_STATUS(Session["connectionString"].ToString(), pickingHeader);
                        if (Page.IsCallback)
                        {
                            DevExpress.Web.ASPxWebControl.RedirectOnCallback("DispatchPanel.aspx");
                        }
                        else
                        {
                            Response.Redirect("DispatchPanel.aspx");
                        }
                    }
                    ASPxSpinEdit2.Text = pickingHeader;
                    if ((!Convert.IsDBNull(ds.Tables[0].Rows[0]["NAME_CUSTOMER"])))
                    {
                        ASPxTextBox3.Text  = Convert.ToString(ds.Tables[0].Rows[0]["NAME_CUSTOMER"]);
                        ASPxTextBox3.Value = Convert.ToString(ds.Tables[0].Rows[0]["CODE_CUSTOMER"]);
                    }
                    if ((!Convert.IsDBNull(ds.Tables[0].Rows[0]["LOGIN"])))
                    {
                        ASPxTextBox6.Text = Convert.ToString(ds.Tables[0].Rows[0]["LOGIN"]);
                    }
                    if ((!Convert.IsDBNull(ds.Tables[0].Rows[0]["REFERENCE"])))
                    {
                        ASPxTextBox4.Text = Convert.ToString(ds.Tables[0].Rows[0]["REFERENCE"]);
                    }
                    if ((!Convert.IsDBNull(ds.Tables[0].Rows[0]["DOC_SAP_RECEPTION"])))
                    {
                        ASPxTextBox5.Text = Convert.ToString(ds.Tables[0].Rows[0]["DOC_SAP_RECEPTION"]);
                    }
                    if ((!Convert.IsDBNull(ds.Tables[0].Rows[0]["NAME_CLASSIFICATION"])))
                    {
                        ASPxTextBox7.Text = Convert.ToString(ds.Tables[0].Rows[0]["NAME_CLASSIFICATION"]);
                    }
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('" + pResult + "');", true);
                }
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true);
            }
        }
        public void LoadGridView(int codeIncome)
        {
            try
            {
                var pResult = "";
                _ds = _objPicking.GePickingInPanelReception(codeIncome, Session["connectionString"].ToString(), ref pResult);
                MobilityScm.Modelo.Entidades.PickingEncabezado pickingEncabezado = new MobilityScm.Modelo.Entidades.PickingEncabezado();

                pickingEncabezado.PICKING_HEADER = codeIncome;
                if (pResult == "")
                {
                    Session["dsReporte"] = _ds;
                    if (!Convert.IsDBNull(_ds))
                    {
                        if (_ds.Tables[0].Rows.Count > 0)
                        {
                            if (!Convert.IsDBNull(_ds.Tables[0].Rows[0]["TASK_ID"]))
                            {
                                Session["TASK_ID_PANEL_PICKING"] = Convert.ToString(_ds.Tables[0].Rows[0]["TASK_ID"]);

                                pickingEncabezado.TASK_ID = int.Parse(Convert.ToString(_ds.Tables[0].Rows[0]["TASK_ID"]));
                            }
                            if (!Convert.IsDBNull(_ds.Tables[0].Rows[0]["NAME_CLASSIFICATION"]))
                            {
                                pickingEncabezado.CLASSIFICATION_PICKING = Convert.ToString(_ds.Tables[0].Rows[0]["NAME_CLASSIFICATION"]);
                            }
                            if ((!Convert.IsDBNull(_ds.Tables[0].Rows[0]["NAME_CUSTOMER"])))
                            {
                                pickingEncabezado.CODE_CLIENT = Convert.ToString(_ds.Tables[0].Rows[0]["NAME_CUSTOMER"]);
                            }
                            if ((!Convert.IsDBNull(_ds.Tables[0].Rows[0]["LOGIN"])))
                            {
                                pickingEncabezado.LOGIN = Convert.ToString(_ds.Tables[0].Rows[0]["LOGIN"]);
                            }
                            if ((!Convert.IsDBNull(_ds.Tables[0].Rows[0]["REFERENCE"])))
                            {
                                pickingEncabezado.REFERENCE = Convert.ToString(_ds.Tables[0].Rows[0]["REFERENCE"]);
                            }
                            if ((!Convert.IsDBNull(_ds.Tables[0].Rows[0]["DOC_SAP_RECEPTION"])))
                            {
                                pickingEncabezado.DOC_SAP_RECEPTION = Convert.ToString(_ds.Tables[0].Rows[0]["DOC_SAP_RECEPTION"]);
                            }
                            if ((!Convert.IsDBNull(_ds.Tables[0].Rows[0]["COMMENTS"])))
                            {
                                pickingEncabezado.COMMENTS = Convert.ToString(_ds.Tables[0].Rows[0]["COMMENTS"]);
                            }
                            if ((!Convert.IsDBNull(_ds.Tables[0].Rows[0]["ALLOW_STORAGE_ON_DIFF"])))
                            {
                                pickingEncabezado.CODE_WAREHOUSE_SOURCE = _ds.Tables[0].Rows[0]["ALLOW_STORAGE_ON_DIFF"].ToString();
                            }
                            if ((!Convert.IsDBNull(_ds.Tables[0].Rows[0]["SCANNING_STATUS"])))
                            {
                                pickingEncabezado.STATUS = _ds.Tables[0].Rows[0]["SCANNING_STATUS"].ToString();
                            }
                        }
                        if (_ds.Tables[1].Rows.Count > 0)
                        {
                            UiVistaDetalle.DataSource = _ds.Tables[1];
                            var regionCombo = (UiVistaDetalle.Columns["CODE_SKU"] as GridViewDataComboBoxColumn);
                            if (regionCombo != null)
                            {
                                regionCombo.PropertiesComboBox.DataSource = _ds.Tables[1].DefaultView.ToTable(true,
                                                                                                              "CODE_SKU");
                                regionCombo.PropertiesComboBox.ValueField = "CODE_SKU";
                                regionCombo.PropertiesComboBox.TextField  = "CODE_SKU";
                            }

                            UiVistaDetalle.DataBind();
                            Session["DATOS"] = _ds;

                            //ASPxComboBox4.Text = Convert.ToString(ds.Tables[1].Rows[0]["CODE_SKU"]);
                            //ASPxTextBox3.Text = Convert.ToString(ds.Tables[1].Rows[0]["DESCRIPTION_SKU"]);
                            //ASPxSpinEdit1.Number = Convert.ToInt32(ds.Tables[1].Rows[0]["EXPECTED"]);
                        }


                        ASPxGridView1.JSProperties.Add("cpTerminoDeCargarDetalle", pickingEncabezado.PICKING_HEADER + "|" +
                                                       pickingEncabezado.TASK_ID + "|" +
                                                       pickingEncabezado.CLASSIFICATION_PICKING + "|" +
                                                       pickingEncabezado.CODE_CLIENT + "|" +
                                                       pickingEncabezado.LOGIN + "|" +
                                                       pickingEncabezado.REFERENCE + "|" +
                                                       pickingEncabezado.DOC_SAP_RECEPTION + "|" +
                                                       pickingEncabezado.COMMENTS + "|" +
                                                       pickingEncabezado.CODE_WAREHOUSE_SOURCE + "|" +
                                                       pickingEncabezado.STATUS);
                    }
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('" + pResult + "');", true);
                    ASPxGridView1.JSProperties.Add("cpError", pResult);
                }
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true);
                ASPxGridView1.JSProperties.Add("cpError", ex.Message);
            }
        }