Beispiel #1
0
        /* ------------------------------------------------------------- */



        /* UPDATE IMAGE BOOK */
        public ActionResult UpdateImg(int Id, HttpPostedFileBase File)
        {
            string path = "";

            if (File.ContentLength > 0)
            {
                string File_Name = Path.GetFileName(File.FileName);
                path = Path.Combine(Server.MapPath("~/UploadFiles"), File_Name);
                File.SaveAs(path);
                BookAction.Update_Img(Id, File_Name);
            }
            RecordAction.Create_Record(CustomerAction.Find_Customer((int)Session["id"]).email, CustomerAction.Find_Customer((int)Session["id"]).email + " change image from " + BookAction.Find_Book(Id).ten_sach, DateTime.Now.Date);
            return(Redirect("~/Book/BookDetail/" + Id));
        }