Пример #1
0
        public void CreateRegionOptions(IEnumerable<MetroRegion> regions)
        {
            this.RegionOptions = new List<SelectListItem>();

            foreach (var region in regions)
            {
                var item = new SelectListItem();
                item.Text = region.Name;
                item.Value = region.Id.ToString();
                this.RegionOptions.Add(item);
            }
        }
Пример #2
0
        public AddReportViewModel()
        {
            var channels = db.sales_channel.ToList();

            foreach (var c in channels)
            {
                SelectListItem sli = new SelectListItem() { Value = c.id.ToString(), Text = c.short_name };
                _SalesChannels.Add(sli);
            }

            var poses = db.POS.ToList();

            foreach (var p in poses)
            {
                SelectListItem sli = new SelectListItem() { Value = p.id.ToString(), Text = p.name };
                _POSes.Add(sli);
            }
        }
Пример #3
0
        public AddEmployeeUserViewModel()
        {
            var emps = db.employee.ToList();

            foreach (var e in emps)
            {
                SelectListItem sli = new SelectListItem();
                sli.Value = e.id.ToString();
                sli.Text = (e.lastname + " " + e.firstname + " " + e.middlename).Trim();
                _Employees.Add(sli);
            }

            var poses = db.POS.ToList();

            foreach (var p in poses)
            {
                SelectListItem sli = new SelectListItem();
                sli.Value = p.id.ToString();
                sli.Text = p.name;
                _POSES.Add(sli);
            }

            var positions = db.position.ToList();

            foreach (var p in positions)
            {
                SelectListItem sli = new SelectListItem();
                sli.Value = p.id.ToString();
                sli.Text = p.name;
                _Positions.Add(sli);
            }

            var roles = db.AspNetRoles.ToList();

            foreach (var r in roles)
            {
                SelectListItem sli = new SelectListItem();
                sli.Value = r.Id;
                sli.Text = r.Name;
                _Roles.Add(sli);
            }
        }
Пример #4
0
        public OSPGroupViewModel()
        {
            var employees = db.employee.ToList();

            foreach (var e in employees)
            {
                SelectListItem sli = new SelectListItem();
                sli.Value = e.id.ToString();
                sli.Text = (e.lastname + " " + e.firstname + " " + e.middlename).Trim();
                _Employees.Add(sli);
            }
        }
Пример #5
0
        public SKKViewModel()
        {
            var branches = db.branch.ToList();

            foreach (var b in branches)
            {
                SelectListItem sli = new SelectListItem();
                sli.Value = b.id.ToString();
                sli.Text = b.short_name;
                _Branches.Add(sli);
            }
        }
Пример #6
0
        public POSViewModel()
        {
            var skks = db.SKK.ToList();

            foreach (var s in skks)
            {
                SelectListItem sli = new SelectListItem();
                sli.Value = s.id.ToString();
                sli.Text = s.id.ToString() + " - " + s.short_name;
                _SKKS.Add(sli);
            }
            var ospgroups = db.GroupOSP.ToList();

            foreach (var o in ospgroups)
            {
                SelectListItem sli = new SelectListItem();
                sli.Value = o.id.ToString();
                sli.Text = o.name;
                _OSPGroups.Add(sli);
            }
            var employees = db.employee.ToList();

            foreach (var e in employees)
            {
                SelectListItem sli = new SelectListItem();
                sli.Value = e.id.ToString();
                sli.Text = (e.lastname + " " + e.firstname + " " + e.middlename).Trim();
                _Employees.Add(sli);
            }
        }
Пример #7
0
            public Detail()
            {
                var details = db.product.ToList();

                foreach (var d in details)
                {
                    SelectListItem sli = new SelectListItem() { Value = d.id.ToString(), Text = d.short_name};
                    _Products.Add(sli);
                }
            }
Пример #8
0
        public ProductViewModel()
        {
            var pgs = db.product_group;

            foreach (var pg in pgs)
            {
                SelectListItem sli = new SelectListItem();
                sli.Value = pg.id.ToString();
                sli.Text = pg.short_name;
                _ProductGroups.Add(sli);
            }
        }
Пример #9
0
        public EditEmployeeViewModel()
        {
            var emps = db.employee.ToList();

            foreach (var e in emps)
            {
                SelectListItem sli = new SelectListItem();
                sli.Value = e.id.ToString();
                sli.Text = (e.lastname + " " + e.firstname + " " + e.middlename).Trim();
                _MAGs.Add(sli);
                _Chiefs.Add(sli);
            }

            var poses = db.POS.ToList();

            foreach (var p in poses)
            {
                SelectListItem sli = new SelectListItem();
                sli.Value = p.id.ToString();
                sli.Text = p.name;
                _POSES.Add(sli);
            }

            var positions = db.position.ToList();

            foreach (var p in positions)
            {
                SelectListItem sli = new SelectListItem();
                sli.Value = p.id.ToString();
                sli.Text = p.name;
                _Positions.Add(sli);
            }
        }