protected void Button1_Click(object sender, EventArgs e)
        {
            if (FBId != null)
            {
                string email = DisplayEmail.ToString();

                using (projectEntities1 context = new projectEntities1())
                {
                    var customer_alt = (from c in context.Customer_Info
                                        where c.Email == email
                                        select c).ToList();

                    if (customer_alt != null)
                    {
                        Response.Redirect("default.aspx");
                    }
                }


                using (projectEntities1 context = new projectEntities1())
                {
                    Customer_Info customer = new Customer_Info();
                    customer.Customer_Name     = displayname.ToString();
                    customer.Email             = DisplayEmail.ToString();
                    customer.Customer_Password = FBId.ToString();
                    customer.Phone_No          = "phone no";

                    context.Customer_Info.Add(customer);
                    context.SaveChanges();

                    Session["Customer_Id"] = displayname.ToString();
                }
                Response.Redirect("~/default.aspx");
            }
        }
Exemple #2
0
 public ActionResult Addcountry(AddCountrymodel add)
 {
     using (projectEntities1 db = new projectEntities1())
     {
         if (Session["Id"] != null)
         {
             int         id  = Convert.ToInt32(Session["Id"].ToString());
             MembersData usr = db.MembersDatas.Where(u => u.Id == id).FirstOrDefault();
             {
                 admin a = db.admins.Where(u => u.CreatedBy == id).FirstOrDefault();
                 {
                     Country c = new Country();
                     c.Country1    = add.country;
                     c.Description = add.dis;
                     c.Date        = DateTime.Now;
                     c.AdminId     = a.Id;
                     c.IsActive    = true;
                     db.Countries.Add(c);
                     db.SaveChanges();
                 }
             }
             return(View());
         }
     }
     return(View());
 }
Exemple #3
0
 public ActionResult Login(MembersData ml)
 {
     using (projectEntities1 db = new projectEntities1())
     {
         MembersData usr = db.MembersDatas.Where(u => u.EmailId == ml.EmailId && u.Password == ml.Password).FirstOrDefault();
         if (usr != null)
         {
             Session["Id"]       = usr.Id;
             TempData["Success"] = "Loggin Successfully!";
             if (usr.ModifiedBy == 1)
             {
                 return(RedirectToAction("Dashboard", "Admin"));
             }
             else
             {
                 return(RedirectToAction("SearchNotes", "NoteDetails"));
             }
         }
         else
         {
             TempData["Success"] = "EmailId or Password is wrong";
             ModelState.AddModelError("", "EmailId or Password is wrong");
             return(RedirectToAction("Login", "Auth"));
         }
     }
 }
Exemple #4
0
        public ActionResult Members()
        {
            projectEntities1   db      = new projectEntities1();
            List <MembersData> members = db.MembersDatas.ToList();

            return(View(members));
        }
Exemple #5
0
        public ActionResult DownloadNotes()
        {
            using (projectEntities1 db = new projectEntities1())
            {
                AddownloadView adddownloads = new AddownloadView
                {
                    Adddownload = (from buyer in db.Buyers

                                   join member in db.MembersDatas on buyer.MemberId equals member.Id
                                   join seller in db.Sellers on buyer.MemberId equals seller.ModifiedBy
                                   join note in db.NoteDetails on buyer.BookId equals note.Id
                                   where note.OwnerId == seller.MemberId
                                   select new Addownload
                    {
                        category = note.Category,
                        title = note.NoteTitle,
                        buyer = buyer.MembersData.FirstName,
                        seller = seller.MembersData.FirstName,
                        selltype = note.SellFor,
                        sellprice = note.SellPrice,
                        downloadate = seller.ApprovedDate
                    }
                                   ).ToList()
                };
                ViewData["Notedetail"] = db.NoteDetails.ToList();
                ViewData["Buyer"]      = db.Buyers.ToList();
                ViewData["Seller"]     = db.Sellers.ToList();

                //List<Buyer> user = db.Buyers.Where(u => u.MemberId == id1).ToList();

                return(View(adddownloads));
            }
        }
Exemple #6
0
        public ActionResult UnderReview()
        {
            projectEntities1  db    = new projectEntities1();
            List <NoteDetail> notes = db.NoteDetails.ToList();

            return(View(notes));
        }
Exemple #7
0
        public ActionResult DashBoard(string searchn)
        {
            projectEntities1 db = new projectEntities1();

            if (Session["Id"] != null)
            {
                int id = Convert.ToInt32(Session["Id"].ToString());


                MembersData usr = db.MembersDatas.Where(u => u.Id == id).FirstOrDefault();
                {
                    List <NoteDetail> notes = db.NoteDetails.Where(u => u.OwnerId == id).ToList();

                    {
                        //List<NoteDetail> notes = db.NoteDetails.ToList();
                        if (!string.IsNullOrEmpty(searchn))
                        {
                            notes = notes.Where(e => e.NoteTitle.ToLower().Contains(searchn.ToLower())).ToList();
                            return(View(notes));
                        }


                        return(View(notes));
                    }
                }
            }
            return(View());
        }
Exemple #8
0
 public ActionResult ChangePass(ChangePassModel cpm)
 {
     if (Session["Id"] != null)
     {
         int id = Convert.ToInt32(Session["Id"].ToString());
         using (projectEntities1 db = new projectEntities1())
         {
             MembersData usr = db.MembersDatas.Where(u => u.Id == id).FirstOrDefault();
             {
                 if (cpm.OldPassword == usr.Password)
                 {
                     usr.CPassword = cpm.CPassword;
                     usr.Password  = cpm.CPassword;
                     db.SaveChanges();
                     TempData["Success"] = "Password  Successfully Changed!";
                     return(RedirectToAction("Login", "Auth"));
                 }
                 else
                 {
                     TempData["Success"] = "OldPassword miss match";
                     return(RedirectToAction("Registration", "Auth"));
                 }
             }
         }
     }
     else
     {
         return(RedirectToAction("Forgot", "Auth"));
     }
 }
Exemple #9
0
        public ActionResult ContactUs(ContactUsModel model)
        {
            MailMessage mm = new MailMessage("*****@*****.**", model.EmaiId)
            {
                Subject    = model.FirstName,
                Body       = "Hello," + "<div>-----" + "<div>Subject:  " + model.Subject + "<div>Cmment/Questions:  " + model.comment + "<div><div>-----<div>Regards," + "<div>" + model.FirstName,
                IsBodyHtml = true
            };

            SmtpClient smtp = new SmtpClient();

            smtp.Host      = "smtp.gmail.com";
            smtp.Port      = 587;
            smtp.EnableSsl = true;

            smtp.UseDefaultCredentials = false;
            smtp.Credentials           = new NetworkCredential("*****@*****.**", "Note@tatva");
            smtp.Send(mm);

            projectEntities1 db = new projectEntities1();
            comment          c  = new comment();

            c.FullName = model.FirstName;
            c.EmailId  = model.EmaiId;
            c.Comment1 = model.comment;
            c.Subject  = model.Subject;
            db.comments.Add(c);
            db.SaveChanges();

            TempData["Success"] = "Email sent Successfully Done!";
            return(RedirectToAction("ContactUs", "Auth"));
        }
Exemple #10
0
 public ActionResult NoteDetail(int id, Notedetailmodal notedetailmodal)
 {
     projectEntities1 db   = new projectEntities1();
     NoteDetail       data = db.NoteDetails.Where(u => u.Id == id).FirstOrDefault();
     {
         return(View(data));
     }
 }
Exemple #11
0
        public ActionResult AddNotes()
        {
            projectEntities1 db = new projectEntities1();

            ViewData["Category"] = db.Categories.ToList <Category>();
            ViewData["Type"]     = db.Types.ToList();
            ViewData["Country"]  = db.Countries.ToList();
            return(View());
        }
Exemple #12
0
 public ActionResult Approve(int id)
 {
     projectEntities1 db   = new projectEntities1();
     NoteDetail       data = db.NoteDetails.Where(u => u.Id == id).FirstOrDefault();
     {
         data.Status = "Published";
         db.SaveChanges();
         return(View());
     }
 }
Exemple #13
0
 public ActionResult ConfirmEmail(string Email)
 {
     using (projectEntities1 db = new projectEntities1())
     {
         MembersData usr = db.MembersDatas.Where(u => u.EmailId == Email).FirstOrDefault();
         usr.IsEmailVerified = true;
         usr.CPassword       = "******";
         db.SaveChanges();
         return(View(usr));
     }
 }
        protected void Button1_Click(object sender, EventArgs e)
        {
            string email = TextBox1.Text;

            using (projectEntities1 context = new projectEntities1())
            {
                var user = (from c in context.Customer_Info
                            where c.Email == email
                            select c).FirstOrDefault();


                if (user != null)
                {
                    string      username           = user.Customer_Name;
                    string      password           = user.Customer_Password;
                    Application OutlookApplication = new Application();


                    MailItem message = (MailItem)OutlookApplication.CreateItem(OlItemType.olMailItem);

                    MailAddress toAddress = new MailAddress(email);


                    message.To         = toAddress.ToString();
                    message.Subject    = "Password Recovery";
                    message.HTMLBody   = "Your Username is:" + username + "<br/><br/>" + "Your Password is:" + password;
                    message.BodyFormat = OlBodyFormat.olFormatHTML;

                    message.Send();

                    //MailMessage msg = new MailMessage();
                    //msg.From = new MailAddress("mail address");
                    //msg.To.Add(email);
                    //msg.Subject = " Recover your Password";
                    //msg.Body = ("Your Username is:" + username + "<br/><br/>" + "Your Password is:" + password);
                    //msg.IsBodyHtml = true;

                    //SmtpClient smt = new SmtpClient();
                    //smt.Host = "smtp.gmail.com";
                    //System.Net.NetworkCredential ntwd = new NetworkCredential();
                    //ntwd.UserName = "******";
                    //ntwd.Password = "******";
                    //smt.UseDefaultCredentials = true;
                    //smt.Credentials = ntwd;
                    //smt.Port = 587;
                    //smt.EnableSsl = true;
                    //smt.Send(msg);

                    //Label2.Text = "Username and Password Sent Successfully";
                    //Label2.ForeColor = System.Drawing.Color.ForestGreen;
                }
            }
        }
Exemple #15
0
        public ActionResult Employee(Employee_Info objUser)
        {
            using (projectEntities1 context = new projectEntities1())
            {
                string name = Session["UserName"].ToString();
                if (name == "admin")
                {
                    return(RedirectToAction("../Employee_Info/Index"));
                }
            }

            return(RedirectToAction("Dashboard"));
        }
Exemple #16
0
        public ActionResult MyRejected()
        {
            projectEntities1  db    = new projectEntities1();
            List <NoteDetail> notes = db.NoteDetails.ToList();

            if (Session["Id"] != null)
            {
                int id1 = Convert.ToInt32(Session["Id"].ToString());

                return(View(notes));
            }
            return(View());
        }
Exemple #17
0
        public ActionResult EditNotes(string noteid, AddNotesModel notesModel, HttpPostedFileBase dp, HttpPostedFileBase uploadnote, HttpPostedFileBase notepreview)
        {
            if (Session["Id"] != null)
            {
                int id = Convert.ToInt32(Session["Id"].ToString());
                using (projectEntities1 db = new projectEntities1())
                {
                    MembersData usr = db.MembersDatas.Where(u => u.Id == id).FirstOrDefault();
                    {
                        NoteDetail notes = db.NoteDetails.Where(u => u.NoteTitle == noteid).FirstOrDefault();
                        {
                            notes.Status = "Inreview";

                            string fileName = Path.GetFileName(dp.FileName);

                            notesModel.dppath = "~/images/" + fileName;
                            fileName          = Path.Combine(Server.MapPath("~/images/"), fileName);
                            dp.SaveAs(fileName);



                            string fileName1 = Path.GetFileName(uploadnote.FileName);


                            notesModel.uploadpath = "~/images/" + fileName1;
                            fileName = Path.Combine(Server.MapPath("~/images/"), fileName1);
                            uploadnote.SaveAs(fileName);


                            string fileName2 = Path.GetFileName(notepreview.FileName);

                            notesModel.notepath = "~/images/" + fileName2;
                            fileName            = Path.Combine(Server.MapPath("~/images/"), fileName2);
                            notepreview.SaveAs(fileName);

                            notes.ApprovedDate = DateTime.Now;
                            notes.DisplayPic   = notesModel.dppath;
                            notes.Preview      = notesModel.notepath;
                            notes.note         = notesModel.uploadpath;
                            db.SaveChanges();
                            return(RedirectToAction("SearchNotes", "NoteDetails"));
                        }
                    }
                }
            }
            else

            {
                return(View());
            }
        }
Exemple #18
0
        public ActionResult PublishNote(string seller)
        {
            projectEntities1  db    = new projectEntities1();
            List <NoteDetail> notes = db.NoteDetails.ToList();

            ViewData["Notedetail"] = db.NoteDetails.ToList();
            //if (seller != "Seller Name" && !string.IsNullOrEmpty(seller))
            //{
            //    notes = notes.Where(e => e.OwnerId!=0 && e.Contains(seller)).ToList();

            //}

            return(View(notes));
        }
Exemple #19
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     using (projectEntities1 context = new projectEntities1())
     {
         Customer_Info _insert = new Customer_Info();
         _insert.Customer_Name     = TextBox1.Text;
         _insert.Email             = TextBox2.Text;
         _insert.Customer_Password = TextBox3.Text;
         _insert.Phone_No          = Decimal.Parse(TextBox4.Text);
         context.Customer_Info.Add(_insert);
         context.SaveChanges();
     }
     Response.Redirect("Log-In.aspx");
 }
Exemple #20
0
        //ContactUs
        public ActionResult UserProfile(UserProfileModal userProfile)
        {
            int id = Convert.ToInt32(Session["Id"].ToString());

            using (projectEntities1 db = new projectEntities1())
            {
                MembersData usr = db.MembersDatas.Where(u => u.Id == id).FirstOrDefault();
                {
                    userProfile.FirstName = usr.FirstName;
                    userProfile.LastName  = usr.LastName;
                    userProfile.EmailId   = usr.EmailId;

                    return(View(userProfile));
                }
            }
        }
        protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
        {
            using (projectEntities1 context = new projectEntities1())
            {
                int customer = int.Parse((from c in context.Customer_Info
                                          where c.Customer_Name == Login1.UserName && c.Customer_Password == Login1.Password
                                          select c.Customer_Id).FirstOrDefault().ToString());

                if (customer > 0)
                {
                    Session["Customer_Id"] = customer;
                    //Login1.DestinationPageUrl = "~/default.aspx";
                    FormsAuthentication.RedirectFromLoginPage(Login1.UserName, true);
                }
            }
        }
Exemple #22
0
        public ActionResult SearchNotes(string searchn, string country, string type, string category, string university, string course)
        {
            NoteDetail       nm = new NoteDetail();
            Notedetailmodal  sn = new Notedetailmodal();
            projectEntities1 db = new projectEntities1();

            ViewData["Category"]   = db.Categories.ToList <Category>();
            ViewData["Type"]       = db.Types.ToList();
            ViewData["Country"]    = db.Countries.ToList();
            ViewData["Rate"]       = db.Ratings.ToList();
            ViewData["Course"]     = db.NoteDetails.ToList();
            ViewData["University"] = db.NoteDetails.ToList();

            List <NoteDetail> notes = db.NoteDetails.ToList();

            if (!string.IsNullOrEmpty(searchn))
            {
                notes = notes.Where(e => e.NoteTitle.ToLower().Contains(searchn.ToLower())).ToList();
            }
            if (country != "Select country" && !string.IsNullOrEmpty(country))
            {
                notes = notes.Where(e => e.Country != null && e.Country.ToLower().Contains(country.ToLower())).ToList();
            }
            if (type != "Select Type" && !string.IsNullOrEmpty(type))
            {
                notes = notes.Where(e => e.Type != null && e.Type.ToLower().Contains(type.ToLower())).ToList();
            }

            if (category != "Select category" && !string.IsNullOrEmpty(category))
            {
                notes = notes.Where(e => e.Category != null && e.Category.ToLower().Contains(category.ToLower())).ToList();
            }

            if (university != "Select University" && !string.IsNullOrEmpty(university))
            {
                notes = notes.Where(e => e.University != null && e.University.ToLower().Contains(university.ToLower())).ToList();
            }

            if (course != "Select Course" && !string.IsNullOrEmpty(course))
            {
                notes = notes.Where(e => e.Course != null && e.Course.ToLower().Contains(course.ToLower())).ToList();
            }



            return(View(notes));
        }
Exemple #23
0
 public ActionResult Login(Employee_Info objUser)
 {
     if (ModelState.IsValid)
     {
         using (projectEntities1 context = new projectEntities1())
         {
             var obj = context.Employee_Info.Where(a => a.Employee_Name.Equals(objUser.Employee_Name) && a.Password.Equals(objUser.Password)).FirstOrDefault();
             if (obj != null)
             {
                 Session["UserID"]   = obj.Employee_Id.ToString();
                 Session["UserName"] = obj.Employee_Name.ToString();
                 return(RedirectToAction("Dashboard"));
             }
         }
     }
     return(View(objUser));
 }
Exemple #24
0
 public ActionResult DeleteNotes(int noteid)
 {
     if (Session["Id"] != null)
     {
         int id = Convert.ToInt32(Session["Id"].ToString());
         using (projectEntities1 db = new projectEntities1())
         {
             MembersData usr = db.MembersDatas.Where(u => u.Id == id).FirstOrDefault();
             {
                 NoteDetail nd = db.NoteDetails.Where(u => u.Id == noteid).FirstOrDefault();
                 {
                     db.NoteDetails.Remove(nd);
                     return(View());
                 }
             }
         }
     }
     return(View());
 }
Exemple #25
0
        public ActionResult Rates(int noteid, RatesModel rt)
        {
            Rating r = new Rating();

            using (projectEntities1 db = new projectEntities1())
            {
                NoteDetail nm = db.NoteDetails.Where(u => u.Id == noteid).FirstOrDefault();
                {
                    r.Date        = DateTime.Now;
                    r.Description = rt.comment;
                    r.BuyerId     = 10;
                    r.NoteId      = noteid;
                    r.Rate        = Convert.ToInt32(Request.Form["rate"]);
                    db.Ratings.Add(r);
                    db.SaveChanges();
                    return(View());
                }
            }
        }
Exemple #26
0
        public ActionResult Forgot(MembersData ml)
        {
            using (projectEntities1 db = new projectEntities1())
            {
                MembersData usr = db.MembersDatas.Where(u => u.EmailId == ml.EmailId).FirstOrDefault();
                if (usr != null)
                {
                    usr.CPassword = "******";
                    usr.Password  = "******";

                    var         fromemail = new MailAddress("*****@*****.**");
                    var         toemail   = new MailAddress(ml.EmailId);
                    MailMessage mm        = new MailMessage("*****@*****.**", ml.EmailId);
                    mm.Subject    = "New temporory password has been genrated for you";
                    mm.IsBodyHtml = true;
                    mm.Body       = "<div>Hello,</div> <div>We have genrated a new password for you .</div> <div>Password :Note@123<div>------</div><div> Regards,<div> NoteMarketplace</div>";


                    SmtpClient smtp = new SmtpClient();
                    smtp.Host           = "smtp.gmail.com";
                    smtp.Port           = 587;
                    smtp.EnableSsl      = true;
                    smtp.DeliveryMethod = SmtpDeliveryMethod.Network;

                    smtp.UseDefaultCredentials = false;
                    smtp.Credentials           = new NetworkCredential(fromemail.Address, "Note@tatva");

                    smtp.Send(mm);
                    db.SaveChanges();
                    TempData["Success"] = "Email sent Successfully Done!";



                    return(RedirectToAction("ChangePass", "Auth"));
                }
                else
                {
                    TempData["Success"] = "EmailId is wrong";
                    ModelState.AddModelError("", "EmailId is wrong");
                    return(RedirectToAction("Forgot", "Auth"));
                }
            }
        }
Exemple #27
0
        public ActionResult BookData()
        {
            projectEntities1 context = new projectEntities1();
            var bookingData          = (from s in context.Show_Info
                                        join b in context.Booking_Details on s.Show_Id equals b.Show_Id
                                        join t in context.Theater_Info on s.Theater_Id equals t.Theater_Id
                                        join m in context.Movie_Info on s.Movie_Id equals m.Movie_Id
                                        where s.Show_Date == DateTime.Today
                                        select new
            {
                t.Theater_Id,
                t.Theater_Name,
                m.Movie_Name,
                s.Start_Time,
                t.Capacity
            });

            return(View(bookingData.ToList()));
        }
Exemple #28
0
        public ActionResult BuyReq()
        {
            if (Session["Id"] != null)
            {
                int id1 = Convert.ToInt32(Session["Id"].ToString());
                using (projectEntities1 db = new projectEntities1())
                {
                    BuyReqView buyReq = new BuyReqView
                    {
                        Buy = (from seller in db.Sellers

                               join member in db.MembersDatas on seller.MemberId equals member.Id
                               join note in db.NoteDetails on seller.BookId equals note.Id
                               join buyer in db.Buyers on seller.ModifiedBy equals buyer.MemberId
                               where seller.MemberId == id1
                               select new BuyReq
                        {
                            title = note.NoteTitle,
                            emailid = buyer.MembersData.EmailId,
                            course = note.Course,
                            sellfor = note.SellFor,
                            sellprice = note.SellPrice,
                            reqdate = buyer.ReqDate,
                            aprov = buyer.ApprovedDate.ToString(),
                            isactive = seller.IsActive,
                            phoneno = seller.MembersData.PhoneNo,
                            id = id1
                        }
                               ).ToList()
                    };


                    //List<Buyer> buyer = db.Buyers.ToList();
                    return(View(buyReq));
                }
            }
            else
            {
                return(View());
            }
        }
Exemple #29
0
        public ActionResult EditNotes(int noteid, AddNotesModel notesModel)
        {
            if (Session["Id"] != null)
            {
                int id = Convert.ToInt32(Session["Id"].ToString());
                using (projectEntities1 db = new projectEntities1())
                {
                    MembersData usr = db.MembersDatas.Where(u => u.Id == id).FirstOrDefault();
                    {
                        NoteDetail nd = db.NoteDetails.Where(u => u.Id == noteid).FirstOrDefault();
                        {
                            ViewData["Category"] = db.Categories.ToList <Category>();
                            ViewData["Type"]     = db.Types.ToList();
                            ViewData["Country"]  = db.Countries.ToList();



                            notesModel.country    = nd.Country;
                            notesModel.category   = nd.Category;
                            notesModel.coursecode = nd.CourseCode;
                            notesModel.coursename = nd.Course;
                            notesModel.Disc       = nd.Description;

                            notesModel.instituename = nd.University;
                            notesModel.Noofpage     = nd.NoOfPages;

                            notesModel.price     = nd.SellPrice;
                            notesModel.professor = nd.Professor;
                            notesModel.Title     = nd.NoteTitle;
                            notesModel.type      = nd.Type;

                            return(View(notesModel));
                        }
                    }
                }
            }
            else
            {
                return(View());
            }
        }
Exemple #30
0
        public ActionResult UserProfile(UserProfileModal userProfile, HttpPostedFileBase dp)
        {
            if (Session["Id"] != null)
            {
                int id = Convert.ToInt32(Session["Id"].ToString());
                using (projectEntities1 db = new projectEntities1())
                {
                    MembersData usr = db.MembersDatas.Where(u => u.Id == id).FirstOrDefault();
                    {
                        string fileName = Path.GetFileName(dp.FileName);
                        userProfile.uploaddp = "~/images/" + fileName;
                        fileName             = Path.Combine(Server.MapPath("~/images/"), fileName);
                        dp.SaveAs(fileName);

                        usr.AddLine1           = userProfile.add1;
                        usr.Addline2           = userProfile.add2;
                        usr.City               = userProfile.city;
                        usr.Collage            = userProfile.collage;
                        usr.Country            = userProfile.country;
                        usr.State              = userProfile.state;
                        usr.University         = userProfile.university;
                        usr.ZipCode            = userProfile.zipcode;
                        usr.DOB                = userProfile.bdate;
                        usr.PhoneNo            = userProfile.phone;
                        usr.IsDetailsSubmitted = true;
                        usr.CPassword          = "******";

                        usr.Gender = "Male";

                        usr.ProfilePicture = userProfile.uploaddp;
                        db.SaveChanges();
                        return(View());
                    }
                }
            }
            else
            {
                return(View());
            }
        }