Beispiel #1
0
        //---------------------------------------------------------------------------------------------------------------------------
        public void GetFamily()
        {
            try
            {
                var pResult = "";
                var ds      = _objSku.GetFamilySku(Session["connectionString"].ToString(), ref pResult);

                if (pResult == "")
                {
                    ASPxCboFamSKU.DataSource = ds;
                    ASPxCboFamSKU.ValueField = "CODE_FAMILY_SKU";
                    ASPxCboFamSKU.TextField  = "DESCRIPTION_FAMILY_SKU";
                    ASPxCboFamSKU.DataBind();
                    Session["dsCodeFamily"] = ds;
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('" + pResult + "');",
                                                        true);
                }
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true);
            }
        }
Beispiel #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (ValidarConexionYUsuarioLogueado(sender))
            {
                try
                {
                    var reporte = new Report.ReportSKU {
                        DataSource = Session["DSDISEÑO"]
                    };
                    ASPxDocumentViewer1.Report = reporte;
                    ASPxDocumentViewer1.DataBind();
                    Connection = Session["connectionString"].ToString();
                    _user      = Session["USER"].ToString();

                    if (!Page.IsPostBack)
                    {
                        Session["dsUnidadesDeMedida"] = null;
                        Session["DSsku"] = null;
                        GetClassification();
                        GetFamily(); /* ------- */
                        GetMeasureUnit();
                    }

                    if (Session["DSsku"] != null)
                    {
                        ASPxGridView1.DataSource = Session["DSsku"];
                        ASPxGridView1.DataBind();
                    }
                    else
                    {
                        GetSku();
                        GetMeasureUnit();
                    }

                    if (Session["dsProviderSKU"] != null)
                    {
                        var ds = (DataSet)Session["dsProviderSKU"];

                        var regionCombo = (ASPxGridView1.Columns["NAME_PROVIDER"] as GridViewDataComboBoxColumn);
                        if (regionCombo != null)
                        {
                            regionCombo.PropertiesComboBox.DataSource = ds.Tables[0].DefaultView.ToTable(true, "NAME_PROVIDER");
                            regionCombo.PropertiesComboBox.ValueField = "NAME_PROVIDER";
                            regionCombo.PropertiesComboBox.TextField  = "NAME_PROVIDER";
                        }

                        ASPxComboBox2.DataSource = ds;
                        ASPxComboBox2.ValueField = "PROVIDER";
                        ASPxComboBox2.TextField  = "NAME_PROVIDER";
                        ASPxComboBox2.DataBind();
                    }
                    else
                    {
                        GetProvider();
                    }

                    //---------------------------------------------------------------------------------------------------------------
                    if (Session["dsCodeFamily"] != null)
                    {
                        var ds = (DataSet)Session["dsCodeFamily"];

                        ASPxCboFamSKU.DataSource = ds;
                        ASPxCboFamSKU.ValueField = "CODE_FAMILY_SKU";
                        ASPxCboFamSKU.TextField  = "DESCRIPTION_FAMILY_SKU";
                        ASPxCboFamSKU.DataBind();
                    }
                    else
                    {
                        GetFamily();
                    }
                    //---------------------------------------------------------------------------------------------------------------
                    if (Session["dsUnidadesDeMedida"] != null)
                    {
                        var ds = (DataSet)Session["dsUnidadesDeMedida"];

                        UiListaUnidadesDeMedida.DataSource = ds;
                        UiListaUnidadesDeMedida.DataBind();
                    }
                    else
                    {
                        GetPackUnit();
                    }
                }
                catch (Exception ex)
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true);
                }
            }
        }