Пример #1
0
        public ActionResult Edit()
        {
            ListMenu();
            Property        p1     = new Property();
            DataSet         ds     = new DataSet();
            List <Property> Upload = new List <Property>();

            try
            {
                p1.id = Request.QueryString["ID"].ToString();
                if (p1.id == "0")
                {
                    p1.id = "";
                }
            }
            catch
            {
                p1.id = "";
            }

            p1.Condition1 = p1.id;
            p1.Condition2 = "";
            p1.Condition3 = "";

            p1.onTable = "CONTENT_EDIT";

            ds = dl.FETCH_CONDITIONAL_QUERY(p1);

            if (ds.Tables[0].Rows.Count > 0)
            {
                var info = new collegedaze.Models.Property()
                {
                    id          = ds.Tables[0].Rows[0]["id"].ToString(),
                    Menu        = ds.Tables[0].Rows[0]["Menu"].ToString(),
                    Title       = ds.Tables[0].Rows[0]["Title"].ToString(),
                    Description = ds.Tables[0].Rows[0]["Description"].ToString(),
                    ThumbImgURL = ds.Tables[0].Rows[0]["ThumbImgURL"].ToString().Replace("~", ""),
                    Status      = ds.Tables[0].Rows[0]["Status"].ToString(),
                    URLTitle    = ds.Tables[0].Rows[0]["URL"].ToString(),
                };

                return(View(info));
            }

            else
            {
                return(RedirectToAction("index"));
            }
            return(View());
        }
Пример #2
0
        public ActionResult Detail(string id)
        {
            ListMenu();
            Property  p1 = new Property();
            DataSet   ds = new DataSet();
            Datalayer dl = new Datalayer();

            try
            {
                p1.Condition1 = id;
            }
            catch
            {
                p1.Condition1 = "";
            }
            p1.Condition2 = "";
            p1.Condition3 = "";
            p1.onTable    = "FETCH_DETAIL";

            ds = dl.FETCH_CONDITIONAL_QUERY(p1);
            if (ds.Tables[0].Rows.Count > 0)
            {
                TempData["Found"] = "1";
                var info = new collegedaze.Models.Property()
                {
                    id          = ds.Tables[0].Rows[0]["id"].ToString(),
                    Title       = ds.Tables[0].Rows[0]["Title"].ToString(),
                    Description = ds.Tables[0].Rows[0]["Description"].ToString(),
                    ImgURL      = ds.Tables[0].Rows[0]["ImgURL"].ToString().Replace("~", ""),
                };

                return(View(info));
            }
            else
            {
                TempData["MSG"] = "Invalid ID!!!";
                return(Redirect("/"));
            }
        }
Пример #3
0
        public ActionResult Home()
        {
            Property p = new Property();

            p.Condition1 = "HOME";
            p.Condition2 = "";
            p.Condition3 = "";
            p.onTable    = "HOME_CONTENT";

            Datalayer dl = new Datalayer();
            DataSet   ds = new DataSet();

            ds = dl.FETCH_CONDITIONAL_QUERY(p);

            var home = new collegedaze.Models.Property()
            {
                id          = ds.Tables[0].Rows[0]["id"].ToString(),
                Title       = ds.Tables[0].Rows[0]["Title"].ToString(),
                Description = ds.Tables[0].Rows[0]["Description"].ToString(),
            };

            return(View(home));
        }