示例#1
0
        public CascadingDropDownNameValue[] GetTruckTypeModelYears(string knownCategoryValues, string category)
        {
            string[] categoryValues             = knownCategoryValues.Split(':', ';');
            Guid     truckModelId               = new Guid(categoryValues[1]);
            List <CascadingDropDownNameValue> l = new List <CascadingDropDownNameValue>();
            TruckModelYearBLL        objTm      = new TruckModelYearBLL();
            List <TruckModelYearBLL> listTM     = new List <TruckModelYearBLL>();

            listTM = objTm.GetActiveTruckModelYearByModelId(truckModelId).OrderBy(tmy => tmy.ModelYearName).ToList();
            foreach (TruckModelYearBLL o in listTM)
            {
                l.Add(new CascadingDropDownNameValue(o.ModelYearName, o.Id.ToString()));
            }
            return(l.ToArray());
        }
示例#2
0
        public CascadingDropDownNameValue[] GetActiveTruckModelYear(string knownCategoryValues, string category)
        {
            string           ModelId = "";
            StringDictionary kv;

            kv = CascadingDropDown.ParseKnownCategoryValuesString(knownCategoryValues);
            if (!kv.ContainsKey("TruckModel") || kv["TruckModel"].ToString() == "")
            {
                throw new ArgumentException("Couldn't find selected Truck Type.");
            }
            ModelId = kv["TruckModel"];
            List <CascadingDropDownNameValue> l = new List <CascadingDropDownNameValue>();
            TruckModelYearBLL        objTm      = new TruckModelYearBLL();
            List <TruckModelYearBLL> listTM     = new List <TruckModelYearBLL>();

            listTM = objTm.GetActiveTruckModelYearByModelId(new Guid(ModelId));
            foreach (TruckModelYearBLL o in listTM)
            {
                l.Add(new CascadingDropDownNameValue(o.ModelYearName, o.Id.ToString()));
            }
            return(l.ToArray());
        }