/**********************************************************************     Quiz Selection (Home)
         *
         **********************************************************************/
        public ActionResult QuizSelection()
        {
            ModelHome home = new ModelHome();

            home = home.DefaultHome();

            return(View(home));
        }
예제 #2
0
        public static string getCartDetails()
        {
            ModelHome            modelHome    = new ModelHome();
            DataTable            table        = modelHome.getCartDetails(Convert.ToString(HttpContext.Current.Session["PP_NTID"].ToString()), Convert.ToString(HttpContext.Current.Session["PP_Domain"].ToString()));
            JavaScriptSerializer jsSerializer = new JavaScriptSerializer();
            var lst = table.AsEnumerable().Select(r => r.Table.Columns.Cast <DataColumn>().Select(c => new KeyValuePair <string, object>(c.ColumnName, r[c.Ordinal])).ToDictionary(z => z.Key, z => z.Value)).ToList();

            return(jsSerializer.Serialize(lst));
        }
예제 #3
0
        public static string getNew()
        {
            ModelHome            modelHome    = new ModelHome();
            DataTable            table        = modelHome.getLatest();
            JavaScriptSerializer jsSerializer = new JavaScriptSerializer();
            var lst = table.AsEnumerable().Select(r => r.Table.Columns.Cast <DataColumn>().Select(c => new KeyValuePair <string, object>(c.ColumnName, r[c.Ordinal])).ToDictionary(z => z.Key, z => z.Value)).ToList();

            return(jsSerializer.Serialize(lst));
        }
예제 #4
0
        public ActionResult Index()
        {
            HomeBO    iHome = new HomeBO();
            ModelHome model = new ModelHome();

            model            = iHome.GetDataForHome();
            _session.IsLogin = false;
            return(View(model));
        }
예제 #5
0
        public static string BCDeleteCartFile(string fileID)
        {
            try
            {
                ModelHome articleDetails = new ModelHome();
                articleDetails.BCDeleteCartFile(Convert.ToInt32(fileID));
            }
            catch (Exception Ex)
            {
                Utility.MessageBox("Error Occurred !!! Please contact system administrator.");
                Utility.CreateErrorLog(Ex.Message.ToString(), "Home.aspx", "Save", "../ErrorLog/");
            }

            return("");
        }
예제 #6
0
        public ModelHome GetDataForHome()
        {
            try
            {
                ModelHome model = new ModelHome();
                using (var db = new DBEntities())
                {
                    var _slider = from c in db.Slides
                                  where c.IsActive && c.Type == "SLIDE_TOP"
                                  orderby c.Sort
                                  select c;
                    if (_slider.Count() > 0)
                    {
                        model.Sliders = _slider.ToList();
                    }

                    var _about = from c in db.Abouts
                                 select c;
                    if (_about.Count() > 0)
                    {
                        model.about = _about.First();
                    }

                    var _product = from c in db.Products
                                   where c.IsActive
                                   orderby c.Sort
                                   select c;
                    if (_product.Count() > 0)
                    {
                        model.Products = _product.ToList();
                    }

                    var _service = from c in db.Services
                                   where c.IsActive
                                   orderby c.Sort
                                   select c;
                    if (_service.Count() > 0)
                    {
                        model.Services = _service.ToList();
                    }
                    return(model);
                }
            }
            catch
            {
                return(null);
            }
        }
예제 #7
0
 public HomeController()
 {
     _modelHome = new ModelHome();
 }