public JsonResult RegisterMember(string name,string lastname,string email,string password)
 {
     Members member = new Members();
     member.CreateDate = DateTime.Now;
     member.BirthDate = DateTime.Now;
     member.Fullname = name + " " + lastname;
     member.Email = email;
     member.Password = password;
     member.Status = 0;
     bool result = MemberBml.Register(member);
     return Json(result, JsonRequestBehavior.AllowGet);
 }
 public static bool Delete(Members member)
 {
     using (FotografPaketiEntities db = new FotografPaketiEntities())
     {
         try
         {
             db.Entry(member).State = System.Data.Entity.EntityState.Deleted;
             db.SaveChanges();
             return true;
         }
         catch (Exception ex)
         {
             return false;
             throw;
         }
     }
 }
        public static bool Register(Members member)
        {
            using (FotografPaketiEntities db = new FotografPaketiEntities())
            {
                if (IsExists(member.Email) || PhotographersBml.IsExists(member.Email))
                    return false;
                else
                {
                    string password = member.Password;
                    bool insertResult = Insert(member);
                    if (insertResult)
                    {
                        bool loginResult = Login(member.Email, password,false);
                        return loginResult;
                    }
                    else
                        return false;
                }

            }
        }
 public static bool Insert(Members member)
 {
     using (FotografPaketiEntities db = new FotografPaketiEntities())
     {
         try
         {
             member.CreateDate = DateTime.Now;
             member.LoginDate = DateTime.Now;
             string hashpassword = FormsAuthentication.HashPasswordForStoringInConfigFile(member.Password, "md5");
             member.Password = hashpassword;
             member.Status = 0;
             db.Members.Add(member);
             db.SaveChanges();
             return true;
         }
         catch (Exception ex)
         {
             return false;
             throw;
         }
     }
 }