Exemplo n.º 1
0
        //Client Registration
        public bool AddClient(Client Newclient)
        {
            Db.Clients.Add(Newclient);
            Db.SaveChanges();


            return(true);
        }
        //public AlbumService(DbContext context)
        //{

        //    Db = context;

        //}

        //Create Album
        public bool CreateAlbum(Album create, HttpPostedFileBase File)
        {
            string filename  = Path.GetFileNameWithoutExtension(File.FileName);
            string extension = Path.GetExtension(File.FileName);

            filename         = filename + DateTime.Now.ToString("yymmssfff") + extension;
            create.ImagePath = "~/Content/Image/Albam/" + filename;
            filename         = Path.Combine(System.Web.HttpContext.Current.Server.MapPath("~/Content/Image/Albam/"), filename);
            File.SaveAs(filename);
            //   create.Status = "Public";

            Db.Set <Album>().Add(create);
            Db.SaveChanges();
            return(true);
        }
        public bool AddFollowers(PhotoGrapherFollower Flw)
        {
            var client = Db.PhotoGrapherFollowers.Where(x => x.Fk_Client_id == Flw.Fk_Client_id && x.Fk_PhotoGrapher_ID == Flw.Fk_PhotoGrapher_ID).SingleOrDefault();

            if (client == null)
            {
                Db.Set <PhotoGrapherFollower>().Add(Flw);
                Db.SaveChanges();
                return(true);
            }

            else
            {
                return(false);
            }
        }
Exemplo n.º 4
0
        //Add Photo
        public bool Upload_Photo_Gallary(PhotoUploadGallary upload, HttpPostedFileBase File)
        {
            string filename  = Path.GetFileNameWithoutExtension(File.FileName);
            string extension = Path.GetExtension(File.FileName);

            filename         = filename + DateTime.Now.ToString("yymmssfff") + extension;
            upload.ImagePath = "~/Content/Image/GallaryPhoto/" + filename;
            filename         = Path.Combine(System.Web.HttpContext.Current.Server.MapPath("~/Content/Image/GallaryPhoto/"), filename);
            upload.Shared    = "public";
            File.SaveAs(filename);


            Db.Set <PhotoUploadGallary>().Add(upload);
            Db.SaveChanges();
            return(true);
        }
        public ActionResult UnFollow(int UnfollowID)
        {
            var result = Db.PhotoGrapherFollowers.Find(UnfollowID);

            Db.PhotoGrapherFollowers.Remove(result);
            Db.SaveChanges();

            return(Redirect(HttpContext.Request.UrlReferrer.AbsoluteUri));
        }
Exemplo n.º 6
0
        public ActionResult GallaryStatus(int id)
        {
            var status_Check = Db.PhotoUploadGallarys.Where(x => x.PhotoID == id).FirstOrDefault();

            if (status_Check.Shared == "public")
            {
                status_Check.Shared = "private";
            }

            else
            {
                status_Check.Shared = "public";
            }

            Db.Configuration.ValidateOnSaveEnabled = false;

            Db.SaveChanges();


            return(Redirect(HttpContext.Request.UrlReferrer.AbsoluteUri));
        }
 public bool AddWarnMemer(Warn Add_warn)
 {
     Db.Set <Warn>().Add(Add_warn);
     Db.SaveChanges();
     return(true);
 }
 public bool AddComplain(ClientComplain Add_complain)
 {
     Db.Set <ClientComplain>().Add(Add_complain);
     Db.SaveChanges();
     return(true);
 }
Exemplo n.º 9
0
        //When Register PhotoGrapher Add
        public bool AddPhotoGrapher(PhotoGrapher pht_Add)
        {
            Db.Set <PhotoGrapher>().Add(pht_Add);
            // Add_basicProfile(pht_Add.Email);
            Db.SaveChanges();



            return(true);
        }
Exemplo n.º 10
0
 public bool AddBlockMemer(Block Add_block)
 {
     Db.Set <Block>().Add(Add_block);
     Db.SaveChanges();
     return(true);
 }
Exemplo n.º 11
0
 public bool AddBooking(PhotoGrapherBooking Booked)
 {
     Db.Set <PhotoGrapherBooking>().Add(Booked);
     Db.SaveChanges();
     return(true);
 }
 //Add Post
 public bool AddJobsPost(ClientJobsPost jobspost)
 {
     Db.Set <ClientJobsPost>().Add(jobspost);
     Db.SaveChanges();
     return(true);
 }
Exemplo n.º 13
0
 public bool AddContact(ClientContact Add_Contact)
 {
     Db.Set <ClientContact>().Add(Add_Contact);
     Db.SaveChanges();
     return(true);
 }
Exemplo n.º 14
0
 public bool Addapplied(JobApplied apply)
 {
     Db.JobApplieds.Add(apply);
     Db.SaveChanges();
     return(true);
 }