예제 #1
0
 public ActionResult CreateAlbum(ActImgView Data, string account)
 {
     if (Data.upload != null)
     {
         string Url = Path.Combine(Server.MapPath("~/FileUpload"), Data.upload.FileName);
         Data.account = User.Identity.Name;
         Data.upload.SaveAs(Url);
         actimgService.Insert(Data, account);
     }
     return(RedirectToAction("Index", "ActImg"));
 }
예제 #2
0
        public ActionResult Index(string Sort)
        {
            //if (Title == null)
            //{
            //    return RedirectToAction("Index", "Home");
            //}
            ActImgView Data = new ActImgView();

            Data.actImgList = actimgService.GetDataList();
            Data.Sort       = Sort;
            return(View(Data));
        }
예제 #3
0
        public void Insert(ActImgView File, string account)
        {
            ActImg Data = new ActImg();

            Data.Sort       = File.Sort;
            Data.Brief      = File.Brief;
            Data.CreateTime = DateTime.Now;
            Data.Img        = File.upload.FileName;
            Data.Account    = HttpContext.Current.User.Identity.Name;
            db.ActImg.Add(Data);
            db.SaveChanges();
        }
예제 #4
0
        public ActionResult CreateAlbum(string Sort)
        {
            ActImgView Data = new ActImgView();
            var        list = new List <SelectListItem>();

            list.Add(new SelectListItem()
            {
                Text = "請選擇分類", Value = "", Selected = true
            });
            list.Add(new SelectListItem()
            {
                Text = "背肌", Value = "背肌"
            });
            list.Add(new SelectListItem()
            {
                Text = "胸肌", Value = "胸肌"
            });
            list.Add(new SelectListItem()
            {
                Text = "腿部", Value = "腿部"
            });
            list.Add(new SelectListItem()
            {
                Text = "腹肌", Value = "腹肌"
            });
            list.Add(new SelectListItem()
            {
                Text = "肩部", Value = "肩部"
            });
            list.Add(new SelectListItem()
            {
                Text = "肱二頭肌", Value = "肱二頭肌"
            });
            list.Add(new SelectListItem()
            {
                Text = "肱三頭肌", Value = "肱三頭肌"
            });
            ViewBag.Sort = list;
            return(View(Data));
        }