/// <summary>
 ///  load the viewmodel data
 /// </summary>
  
 private IEnumerable<iqCompanyVM> GetiqCompanies()
     {
     iqDataEntities iqData = new iqDataEntities();
    
     return from o in iqData.iqCompany
            where (o.coCompanyName != " ")
            select new iqCompanyVM()
            {
                cCompanyNo = o.coCompanyNo,
                cCompanyName = o.coCompanyName,
                cContact = o.coContact,
                cEmail = o.coEmail,
                cPhone = o.coPhone,
                cGroupCode = o.coGroupCode  
            };
     }
        /// <summary>
        /// Get iqData entity
        /// </summary>
        /// <returns></returns>
      public static IEnumerable<iqCompany> GetiqCompanies()
        {
        iqDataEntities entities = new iqDataEntities();
        return entities.iqCompany;

        } 
Esempio n. 3
0
        /// <summary>
        /// Get iqData entity
        /// </summary>
        /// <returns></returns>
        public static IEnumerable <iqCompany> GetiqCompanies()
        {
            iqDataEntities entities = new iqDataEntities();

            return(entities.iqCompany);
        }
        /// <summary>
        /// This method returns data for the Tooltip from data 
        /// example.
        /// </summary>         
        public JsonResult CompanyGridTooltip(int? Id)
        {
            iqDataEntities _dataModel = new iqDataEntities();
            
            if (Id == null)
                Id = 6;
            var CompanyForTooltip = (from m in _dataModel.iqCompany
                                   where m.coCompanyNo == Id
                                   select m).First();

            var data = new
            {
                name = CompanyForTooltip.coCompanyName,
                address = CompanyForTooltip.coAddress1
            };

            // ASP.NET MVC2 Needs JsonRequestBehavior.AllowGet
            // return Json(data, JsonRequestBehavior.AllowGet);
            return Json(data);
        }