public JsonResult MemberRecord(Tbl_Member model)
        {
            _MemberService.Add(model);
            return(Json("Index"));

            //   return RedirectToAction("MemberLogin", "GeneralPage");
        }
Esempio n. 2
0
        public ActionResult Create(Tbl_Member tbl_Member, HttpPostedFileBase Photo, AspNetRole role, AspNetUser aspNetUser)
        {
            if (ModelState.IsValid)
            {
                /// Phone No

                if (Photo.ContentLength > 0)
                {
                    string _FileName = Path.GetFileName(Photo.FileName);
                    string _path     = Path.Combine(Server.MapPath("~/Content/Image"), _FileName);
                    tbl_Member.ImageURL = _FileName;
                    Photo.SaveAs(_path);
                }

                db.Tbl_Member.Add(tbl_Member);
                db.SaveChanges();
                FormsAuthentication.SignOut();
                Session.Abandon();
                return(RedirectToAction("Index"));
            }

            //var result = (from a in tbl_Member//.schemeid
            //              join b in Scheme on  //.schemeid on
            //              a.schemeid equals b.)

            ViewBag.Member = new SelectList(db.Tbl_Member, "SchemeId", "SchemeName");
            //ViewBag.Member = new SelectList(db.role, "Id", "Name");



            return(View(tbl_Member));
        }
Esempio n. 3
0
        public ActionResult DeleteConfirmed(int MemberId)
        {
            Tbl_Member tbl_Member = db.Tbl_Member.Find(MemberId);

            db.Tbl_Member.Remove(tbl_Member);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        public ActionResult MemberRecord(Tbl_Member model)
        {
            model.MemberBlockCount = 0;
            _MemberService.Add(model);
            return(RedirectToAction("Index"));

            //   return RedirectToAction("MemberLogin", "GeneralPage");
        }
Esempio n. 5
0
        // GET: Member/Member/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Tbl_Member tbl_Member = db.Tbl_Member.Find(id);

            if (tbl_Member == null)
            {
                return(HttpNotFound());
            }
            return(View(tbl_Member));
        }
Esempio n. 6
0
        // GET: Member/Member/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Tbl_Member tbl_Member = db.Tbl_Member.Find(id);

            ViewBag.Member = new SelectList(db.Schemes, "SchemeId", "SchemeName");

            if (tbl_Member == null)
            {
                return(HttpNotFound());
            }
            return(View(tbl_Member));
        }
        public JsonResult SignInUser(Tbl_Member user)
        {
            Tbl_Member loginData = _MemberService.LoginControlGet(user.IDNumber, user.MemberPassword);

            if (loginData != null)
            {
                string token    = Guid.NewGuid().ToString() + "æ" + DateTime.Now + "-" + loginData.MemberID;
                string memberID = loginData.MemberID.ToString();
                HttpContext.Session.Set("token", System.Text.Encoding.UTF8.GetBytes(token));
                HttpContext.Session.Set("memberID", System.Text.Encoding.UTF8.GetBytes(memberID));
                HttpContext.Session.SetString("userID", loginData.MemberID.ToString());
                ViewBag.Token          = token;
                TempData["isLoggedIn"] = token.ToString();
                TempData["memberID"]   = memberID.ToString();
                return(Json("Index"));
            }

            return(Json("Giriş Yapın"));
        }
        public JsonResult sendPassword(Tbl_Member member)
        {
            Tbl_Member memberInfo = _MemberService.GetAll().Where(x => x.MemberMail == member.MemberMail).LastOrDefault();

            try
            {
                string nameSurname = memberInfo.MemberName;
                string mail        = memberInfo.MemberMail;
                string message     = "Şifreniz: " + memberInfo.MemberPassword;
                string subject     = "Şifremi Unuttum";

                var    from     = new MailAddress("*****@*****.**");
                var    toAddres = new MailAddress(memberInfo.MemberMail);
                string content  = "AD: " + nameSurname;
                content += "<br>MAİL: " + mail;
                content += "<br>KONU: " + subject;
                content += "<br>Mesaj: " + message;
                using (var smpt = new SmtpClient
                {
                    Host = "smtp.yandex.com",
                    Port = 587,
                    EnableSsl = true,
                    DeliveryMethod = SmtpDeliveryMethod.Network,
                    UseDefaultCredentials = false,
                    Credentials = new System.Net.NetworkCredential("*****@*****.**", "Aynur20")
                })
                {
                    using (var mesaj = new MailMessage(from, toAddres)
                    {
                        Subject = subject, Body = content
                    })
                    {
                        mesaj.IsBodyHtml = true;
                        smpt.Send(mesaj);
                    }
                }
            }
            catch
            {
            }
            return(Json("Mesaj İletildi"));
        }
Esempio n. 9
0
        // GET: Member/Member/Create
        public ActionResult Create()
        {
            List <SelectListItem> sex_items = new List <SelectListItem>();

            sex_items.Add(new SelectListItem()
            {
                Text = "FEMALE", Value = "FEMALE"
            });
            sex_items.Add(new SelectListItem()
            {
                Text = "MALE", Value = "MALE"
            });

            ViewBag.Sex = sex_items;
            //Session["userId"] = Session["userId"];

            ViewBag.Member = new SelectList(db.Schemes, "SchemeId", "SchemeName");
            Tbl_Member tbl_Member = new Tbl_Member();

            tbl_Member.AspUserId = Session["userId"].ToString();
            return(View(tbl_Member));
        }
Esempio n. 10
0
        public ActionResult Edit([Bind(Include = "MemberId,MemberName,Mobile,Email,ImageURL,DateOfBirth,SchemeId,Addess,Sex,Weight,Height,BloodGroup,MemberType,PaymentDetail")] Tbl_Member tbl_Member)
        {
            List <SelectListItem> sex_items = new List <SelectListItem>();

            sex_items.Add(new SelectListItem()
            {
                Text = "FEMALE", Value = "FEMALE"
            });
            sex_items.Add(new SelectListItem()
            {
                Text = "MALE", Value = "MALE"
            });

            ViewBag.Sex    = sex_items;
            ViewBag.Member = new SelectList(db.Tbl_Member, "SchemeId", "SchemeName");
            if (ModelState.IsValid)
            {
                db.Entry(tbl_Member).State = EntityState.Modified;
                db.SaveChanges();

                return(RedirectToAction("Index"));
            }
            return(View(tbl_Member));
        }
 public void Update(Tbl_Member Parameter)
 {
     _Tbl_MemberDal.Update(Parameter);
 }
 public void Delete(Tbl_Member Parameter)
 {
     _Tbl_MemberDal.Delete(Parameter);
 }
 public void Add(Tbl_Member Parameter)
 {
     _Tbl_MemberDal.Add(Parameter);
 }
        public ActionResult SignInUser(Tbl_Member user)
        {
            Tbl_Member loginData = _MemberService.LoginControlGet(user.IDNumber, user.MemberPassword);

            if (loginData != null && loginData.MemberBlockCount < 3)
            {
                string token    = Guid.NewGuid().ToString() + "æ" + DateTime.Now + "-" + loginData.MemberID;
                string memberID = loginData.MemberID.ToString();
                HttpContext.Session.Set("token", System.Text.Encoding.UTF8.GetBytes(token));
                HttpContext.Session.Set("memberID", System.Text.Encoding.UTF8.GetBytes(memberID));
                HttpContext.Session.SetString("userID", loginData.MemberID.ToString());
                ViewBag.Token              = token;
                TempData["isLoggedIn"]     = token.ToString();
                TempData["memberID"]       = memberID.ToString();
                loginData.MemberBlockCount = 0;
                _MemberService.Update(loginData);
                return(RedirectToAction("Index"));
            }
            else
            {
                loginData = _MemberService.GetAll().Where(x => x.IDNumber == user.IDNumber).LastOrDefault();
                if (loginData != null)
                {
                    loginData.MemberBlockCount++;
                    if (loginData.MemberBlockCount >= 3)
                    {
                        var sifre = Guid.NewGuid().ToString().Split('-');
                        loginData.MemberPassword = sifre[0];

                        string nameSurname = loginData.MemberName;
                        string mail        = loginData.MemberMail;
                        string message     = "Yeni Şifreniz: " + loginData.MemberPassword + "ile sisteme yeniden giriş yapabilirsiniz.";
                        string subject     = "3 Defa Hatalı Girilen Şİfre";

                        var    from     = new MailAddress("*****@*****.**");
                        var    toAddres = new MailAddress(loginData.MemberMail);
                        string content  = "AD: " + nameSurname;
                        content += "<br>MAİL: " + mail;
                        content += "<br>KONU: " + subject;
                        content += "<br>Mesaj: " + message;
                        using (var smpt = new SmtpClient
                        {
                            Host = "smtp.yandex.com",
                            Port = 587,
                            EnableSsl = true,
                            DeliveryMethod = SmtpDeliveryMethod.Network,
                            UseDefaultCredentials = false,
                            Credentials = new System.Net.NetworkCredential("*****@*****.**", "Aynur20")
                        })
                        {
                            using (var mesaj = new MailMessage(from, toAddres)
                            {
                                Subject = subject, Body = content
                            })
                            {
                                mesaj.IsBodyHtml = true;
                                smpt.Send(mesaj);
                            }
                        }
                        loginData.MemberBlockCount = 0;
                    }
                    _MemberService.Update(loginData);
                    return(RedirectToAction("Index", "GeneralPage"));
                }
                return(RedirectToAction("Index", "GeneralPage"));
            }
        }