public ActionResult Index()
        {
            IVendorService svc   = new VendorService();
            var            model = svc.GetAll();

            return(View("~/Views/Master/Vendor/Index.cshtml", model));
        }
        public FileResult Download()
        {
            XLWorkbook xlWorkBook  = new XLWorkbook();
            var        xlWorkSheet = xlWorkBook.Worksheets.Add("Master Vendor");

            IVendorService svc   = new VendorService();
            var            model = svc.GetAll();

            xlWorkSheet.Cell(1, 1).Value  = "VENDORID";
            xlWorkSheet.Cell(1, 2).Value  = "VENDORNAME";
            xlWorkSheet.Cell(1, 3).Value  = "STREET";
            xlWorkSheet.Cell(1, 4).Value  = "DISTRIC";
            xlWorkSheet.Cell(1, 5).Value  = "CITY";
            xlWorkSheet.Cell(1, 6).Value  = "POSTALCODE";
            xlWorkSheet.Cell(1, 7).Value  = "TELEPHONE";
            xlWorkSheet.Cell(1, 8).Value  = "EMAIL";
            xlWorkSheet.Cell(1, 9).Value  = "EMAIL2";
            xlWorkSheet.Cell(1, 10).Value = "EMAIL3";
            xlWorkSheet.Cell(1, 11).Value = "EMAIL4";
            xlWorkSheet.Cell(1, 12).Value = "EMAIL5";
            xlWorkSheet.Cell(1, 13).Value = "EMAIL6";
            xlWorkSheet.Cell(1, 14).Value = "EMAIL7";
            xlWorkSheet.Cell(1, 15).Value = "EMAIL8";
            xlWorkSheet.Cell(1, 16).Value = "PLANTIDTSO";
            xlWorkSheet.Cell(1, 16).Value = "ISB2B";
            xlWorkSheet.Range("A1", "Q1").Style.Font.Bold = true;

            int i = 2;

            foreach (var m in model)
            {
                xlWorkSheet.Cell(i, 1).Value  = "'" + m.VENDORID;
                xlWorkSheet.Cell(i, 2).Value  = m.VENDORNAME;
                xlWorkSheet.Cell(i, 3).Value  = m.STREET;
                xlWorkSheet.Cell(i, 4).Value  = m.DISTRIC;
                xlWorkSheet.Cell(i, 5).Value  = m.CITY;
                xlWorkSheet.Cell(i, 6).Value  = m.POSTALCODE;
                xlWorkSheet.Cell(i, 7).Value  = m.TELEPHONE;
                xlWorkSheet.Cell(i, 8).Value  = m.EMAIL;
                xlWorkSheet.Cell(i, 9).Value  = m.EMAIL2;
                xlWorkSheet.Cell(i, 10).Value = m.EMAIL3;
                xlWorkSheet.Cell(i, 11).Value = m.EMAIL4;
                xlWorkSheet.Cell(i, 12).Value = m.EMAIL5;
                xlWorkSheet.Cell(i, 13).Value = m.EMAIL6;
                xlWorkSheet.Cell(i, 14).Value = m.EMAIL7;
                xlWorkSheet.Cell(i, 15).Value = m.EMAIL8;
                xlWorkSheet.Cell(i, 16).Value = m.PLANTIDTSO;
                xlWorkSheet.Cell(i, 16).Value = m.B2B == '1' ? "1" : "0";
                i++;
            }

            xlWorkSheet.Columns().AdjustToContents();
            var path = Server.MapPath("..") + "\\Master-Vendor.xlsx";

            xlWorkBook.SaveAs(path);
            xlWorkBook.Dispose();
            return(File(path, "application/vnd.ms-excel", "Master-Vendor.xlsx"));
        }
Beispiel #3
0
        public IEnumerable <VendorViewModel> GetAll()
        {
            //Log.Information("Log: Log.Information");
            //Log.Warning("Log: Log.Warning");
            //Log.Error("Log: Log.Error");
            //Log.Fatal("Log: Log.Fatal");
            var items = _vendorService.GetAll();

            return(items);
        }
Beispiel #4
0
        public virtual ActionResult List()
        {
            var result = new List <object>();

            result.AddRange(SiteTermService.GetAll().IsActive().Cast <object>());
            result.AddRange(ProductService.GetAll().IsActive().Cast <object>());
            result.AddRange(ProfessionService.GetAll().IsActive().Cast <object>());
            result.AddRange(VendorService.GetAll().IsActive().Cast <object>());
            return(View(result.OrderBy(o => o.GetValue("Name"))));
        }
Beispiel #5
0
        public void AddControlForTestingCenter(SimplePageVM model)
        {
            var vendors = VendorService.GetAll(x =>
                                               Vendor.ForTest.Contains(x.Vendor_ID) && x.IsActive).ToList()
                          .OrderBy(x => Vendor.ForTest.IndexOf(x.Vendor_ID)).ToList();

            model.Controls.Add(
                new SimplePageVM.Control(Views.Shared.Catalog.Vendors, vendors)
            {
                OnBottom = true
            });
        }
        public ActionResult Create(long?id)
        {
            PaymentViewModel viewModel = new PaymentViewModel
            {
                vendors    = vendorService.GetAll(),
                Accounts   = accountService.GetAll(),
                Categories = categoryService.GetAll(),
                Bills      = billService.GetAll(),
                Id         = id ?? 0
            };

            return(View(viewModel));
        }
Beispiel #7
0
        public virtual ActionResult Details(string urlName, string urlPart, int?pageIndex)
        {
            VendorVM model;

            if (urlPart.IsEmpty())
            {
                model = VendorVMService.GetBy(urlName, null);
                if (model == null)
                {
                    return(null);
                }
            }
            else if (urlPart == VendorVM.Tab.Testing)
            {
                if (!pageIndex.HasValue)
                {
                    return(RedirectToAction(() => Details(urlName, urlPart, 1)));
                }
                var vendor = VendorService.GetAll().ByUrlName(urlName);
                if (vendor == null)
                {
                    return(NotFound());
                }
                var exams = new ExamListVM {
                    Exams = ExamService.GetAll().Where(e => e.ExamPrice > 0 && e.Available)
                            .Where(e => e.Vendor_ID == vendor.Vendor_ID)
                            .OrderBy(e => e.Exam_TC)
                            .ToPagedList(pageIndex.GetValueOrDefault() - 1),
                    Vendor = vendor
                };
                model = new VendorVM(vendor)
                {
                    CurrentTab = 2,
                    Exams      = exams
                };
            }
            else
            {
                var vendor = VendorService.GetAll().ByUrlName(urlName);
                if (vendor == null)
                {
                    return(null);
                }
                model = new VendorVM(vendor)
                {
                    CurrentTab = 1
                };
            }

            return(View(model));
        }
Beispiel #8
0
        public ActionResult Create(long?id)
        {
            var viewModel = new BillViewModel
            {
                Categories     = categoryService.GetAll(),
                Currencies     = currencyService.GetAll(),
                Vendors        = vendorService.GetAll(),
                Items          = itemService.GetAll(),
                Taxes          = taxService.GetAll(),
                DefaultSetting = defaultService.GetByUserId(LogedInUser.Id),
                Bill           = id > 0 ? billService.GetById((long)id) : new Bill
                {
                    Number = billService.GenerateBillNumber()
                }
            };

            return(View(viewModel));
        }
Beispiel #9
0
        public virtual MainPageVM Get()
        {
            var sections =
                SectionService.GetAll().IsActive().Where(s => s.ForMainPage)
                .ByWebOrder().ToList();


            var professions = ProfessionService.GetAll().IsActive()
                              .Where(p => p.ForMainPage).ToList()
                              .OrderBy(x => StringUtils.IsBasicLetter(x.Name.First())).ThenBy(x => x.Name).ToList();
            var vendors = VendorService.GetAll().IsActive()
                          .Where(p => p.ForMainPage).ByWebOrder().ToList();
            var products = ProductService.GetAll().IsActive()
                           .Where(p => p.ForMainPage).ToList().OrderBy(x => x.Name).ToList();
            var siteterms = SiteTermService.GetAll().IsActive()
                            .Where(p => p.ForMainPage).ToList().OrderBy(x => x.Name).ToList();

            VideoService.LoadWith(x => x.VideoCategory);
            var videos = VideoService.GetAll(x =>
                                             x.CategoryId == VideoCategories.CoursePresentation)
                         .OrderByDescending(x => x.UpdateDate).Take(3).ToList();

            return
                (new MainPageVM
            {
                Professions = professions,
                Vendors = vendors,
                Sections = sections,
                Products = products,
                Banners = BannerService.GetBanner(CommonConst.SiteRoot + "/")
                          .ShufflePriority(x => x.Priority),
                News = NewsService.GetAllForMain().ToList(),
                SiteTerms = siteterms,
                Videos = videos,
                Documents = CertTypeService
                            .GetAll(c => CertTypes.ForMain.Contains(c.UrlName)).ToList(),
                About = SimplePageService.GetAll().BySysName(SimplePages.MainPage)
            });
        }
Beispiel #10
0
 public ActionResult AddPackage()
 {
     ViewBag.Vendors      = _vendorService.GetAll();
     ViewBag.Destinations = _destinationService.GetAll();
     return(View());
 }
 public List <Vendor> GetAll()
 {
     return(_vendorService.GetAll().ToList());
 }