public IEnumerable <DropDown> GetAllService(int?id)
        {
            var serviceList = _dbContext.Services.Where(a => a.ServiceId == id || id == null || id.ToString() == "").Select(a => new
            {
                Value = a.ServiceId,
                Text  = a.ServiceName
            }).ToList();

            DataTable data = Utility.DataTable.GetDataTable(serviceList);

            return(from DataRow row in data.Rows select DropDown.ConvertToModel(row));
        }
        public IEnumerable <DropDown> GetAllSmtpHosts(int?id)
        {
            var smtpHostList = _dbContext.SmtpHosts.Where(a => a.SmtpHostId == id || id == null || id.ToString() == "").Include(a => a.HostType).Select(a => new
            {
                Value = a.SmtpHostId,
                Text  = a.HostType.HostTypeName
            }).ToList();

            DataTable data = Utility.DataTable.GetDataTable(smtpHostList);

            return(from DataRow row in data.Rows select DropDown.ConvertToModel(row));
        }
        public IEnumerable <DropDown> GetAllPricingTableType(int?id)
        {
            var pricingTableType = _dbContext.PricingTableTypes.Where(a => a.PricingTableTypeID == id || id == null || id.ToString() == "").Select(a => new
            {
                Value = a.PricingTableTypeID,
                Text  = a.PricingTableTypeName
            }).ToList();

            DataTable data = Utility.DataTable.GetDataTable(pricingTableType);

            return(from DataRow row in data.Rows select DropDown.ConvertToModel(row));
        }
        public IEnumerable <DropDown> GetAllNewsLetterEmails(int?id)
        {
            var newsletterMailList = _dbContext.NewsletterMails.Where(a => a.NewsletterMailId == id || id == null || id.ToString() == "").Select(a => new
            {
                Value = a.NewsletterMailId,
                Text  = a.Subject
            }).ToList();

            DataTable data = Utility.DataTable.GetDataTable(newsletterMailList);

            return(from DataRow row in data.Rows select DropDown.ConvertToModel(row));
        }
        public IEnumerable <DropDown> GetAllProductCategories(int?id)
        {
            var productCategoriesList = _dbContext.ProductCategories.Where(a => a.ProductCategoryId == id || id == null || id.ToString() == "").Select(a => new
            {
                Value = a.ProductCategoryId,
                Text  = a.ProductCategoryName
            }).ToList();
            //DataTable data = Utility.DataTable.GetDataTable(designationList);

            //var designationList = _dbContext.Database.SqlQuery<DropDown>(" Select CAST(DesignationId as nchar(10)) as Value, DesignationName as Text from Designations").ToList();
            DataTable data = Utility.DataTable.GetDataTable(productCategoriesList);

            return(from DataRow row in data.Rows select DropDown.ConvertToModel(row));
        }