コード例 #1
0
        public KurumsalUye GetUploadPhoto(KurumsalUye kurumsalUye, HttpPostedFileBase file)
        {
            if (file != null)
            {
                file.SaveAs(HttpContext.Current.Server.MapPath("~/Image/") +
                            new Guid() + "_" + file.FileName);
                kurumsalUye.FotoUrl = new Guid() + "_" + file.FileName;
            }
            db.KurumsalUyeler.Add(kurumsalUye);
            db.SaveChanges();

            return(kurumsalUye);
        }
コード例 #2
0
        public Hayvan GetUploadPhoto(Hayvan hayvan, HttpPostedFileBase file)
        {
            if (file != null)
            {
                file.SaveAs(HttpContext.Current.Server.MapPath("~/Image/") +
                            new Guid() + "_" + file.FileName);
                hayvan.FotoUrl1 = new Guid() + "_" + file.FileName;
            }

            db.Hayvanlar.Add(hayvan);
            db.SaveChanges();

            return(hayvan);
        }