Ejemplo n.º 1
0
        public override void Save()
        {
            ID = Convert.ToInt32(_provider.Insert("Grade", ID, Name, EPower, EVol, MaxLoad, NoLoad, EngineType.ID, Model.ID));

            GradeList gradeList = GradeList.getInstance();

            gradeList.Add(this);
        }
Ejemplo n.º 2
0
        private bool ExtractInitData(string s)
        {
            string[] delim  = { "var initData = {};", "initData.globalLocale =" };
            string[] delim2 = { "initData." };
            string[] delim3 = { " = " };
            char[]   delim4 = { ' ', ';', '\n', '	'};

            string[] s1 = s.Split(delim, StringSplitOptions.None);
            if (s1.Length < 3)
            {
                return(false);
            }

            string s2 = s1[1];

            string[] datum = s2.Split(delim2, StringSplitOptions.RemoveEmptyEntries);

            string product = datum[1].Split(delim3, StringSplitOptions.None)[1];
            string meta    = datum[2].Split(delim3, StringSplitOptions.None)[1];
            string grade   = datum[3].Split(delim3, StringSplitOptions.None)[1];

            product = product.TrimEnd(delim4);
            meta    = meta.TrimEnd(delim4);
            grade   = grade.TrimEnd(delim4);

            _product = JsonConvert.DeserializeObject <Product>(product);
            _meta    = JsonConvert.DeserializeObject <Meta>(meta);
            _grades  = JsonConvert.DeserializeObject <Grade[]>(grade);

            GradeList.Clear();
            BlockList.Clear();

            Grade defaultGrade = new Grade();

            defaultGrade.gradeId = 0;
            defaultGrade.name    = "전체";
            Meta.Draw.BlockInfo defaultBlock = new Meta.Draw.BlockInfo();
            defaultBlock.blockId   = 0;
            defaultBlock.blockName = "전체";
            GradeList.Add(defaultGrade);
            BlockList.Add(defaultBlock);

            foreach (Grade item in _grades)
            {
                GradeList.Add(item);
            }
            foreach (Meta.Draw.BlockInfo item in _meta.draw.blockInfo)
            {
                BlockList.Add(item);
            }

            return(true);
        }
Ejemplo n.º 3
0
        public void loadLists(MerkatoDbContext context)
        {
            SelectListItem all = new SelectListItem()
            {
                Text = "(All)", Value = "0"
            };

            ClientList = context.Client.Select(p => new SelectListItem()
            {
                Text = p.ClientName, Value = p.Id.ToString()
            }).ToList();
            OutletList = context.Outlet.Select(p => new SelectListItem()
            {
                Text = p.Name, Value = p.Id.ToString()
            }).ToList();
            GenderList = context.Gender.Select(p => new SelectListItem()
            {
                Text = p.Name, Value = p.Id.ToString()
            }).ToList();
            GenderList.Add(all);
            SkillsList = context.SkillsProficiency.Select(p => new SelectListItem()
            {
                Text = p.Name, Value = p.Id.ToString()
            }).ToList();
            SkillsList.Add(all);
            LanguageList = context.LanguageProficiency.Select(p => new SelectListItem()
            {
                Text = p.Name, Value = p.Id.ToString()
            }).ToList();
            LanguageList.Add(all);
            GradeList = context.AgentGrade.Select(p => new SelectListItem()
            {
                Text = p.Name, Value = p.Id.ToString()
            }).ToList();
            GradeList.Add(all);

            var query = (from PM in context.ProductMechanism
                         join M in context.Mechanism on PM.MechanismId equals M.Id
                         select new { ProductMechanism = PM, Mechanism = M })
                        .Select(p => new MechanismModel {
                Name = p.Mechanism.Name, Id = p.ProductMechanism.MechanismId
            }).ToList();

            MechanismList = query.Select(p => new SelectListItem()
            {
                Text = p.Name, Value = p.Id.ToString()
            }).ToList();
        }
Ejemplo n.º 4
0
 public void AddGrade(double v)
 {
     GradeList.Add(v);
 }
Ejemplo n.º 5
0
 public override void AddGrade(float grade)
 {
     GradeList.Add(grade);
 }