Exemplo n.º 1
0
        protected void DdlPN_TextChanged(object sender, EventArgs e)
        {
            Cnx.SelecBD();
            using (SqlConnection sqlConB = new SqlConnection(Cnx.GetConex()))
            {
                string VbTxtSql = "EXEC SP_PANTALLA_ADVICE 16, @P,'','','SN',0,0,0,@ICC,'01-1-2009','01-01-1900','01-01-1900'";
                sqlConB.Open();
                using (SqlCommand SC = new SqlCommand(VbTxtSql, sqlConB))
                {
                    SC.Parameters.AddWithValue("@P", DdlPN.Text);
                    SC.Parameters.AddWithValue("@ICC", Session["!dC!@"]);
                    using (SqlDataAdapter SDA = new SqlDataAdapter())
                    {
                        using (DataSet DSTDdl = new DataSet())
                        {
                            SDA.SelectCommand = SC;
                            SDA.Fill(DSTDdl);

                            DdlSN.DataSource     = DSTDdl.Tables[0];
                            DdlSN.DataTextField  = "SN";
                            DdlSN.DataValueField = "Codigo";
                            DdlSN.DataBind();

                            DdlModel.DataSource     = DSTDdl.Tables[1];
                            DdlModel.DataTextField  = "Descripcion";
                            DdlModel.DataValueField = "CodModelo";
                            DdlModel.DataBind();
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
        protected void BindModelDdl(string make, string model, string other)
        {
            List <ModelLookup> models = ModelLookup.GetAllModelsLookup(make);

            DdlModel.DataSource = models;
            DdlModel.DataBind();
            if (model != "")
            {
                if (models.Select(m => m.Model).ToString() == model)
                {
                    DdlModel.SelectedValue = model;
                }
                if (model == "Other")
                {
                    RfvModelOther.Enabled = true;
                    RfvModelOther.Visible = true;
                    TxtModelOther.Enabled = true;
                    TxtModelOther.Visible = true;
                    TxtModelOther.Text    = other;
                }
            }
        }