public ArticleController()
 {
     var emojiRootDir = new DirectoryInfo(System.Web.Hosting.HostingEnvironment.MapPath("/Content/img/emoji/"));
     var emojiPacks = emojiRootDir.GetDirectories();
     _emojis = new List<string>[emojiPacks.Length];
     for (int i = 0; i < emojiPacks.Length; i++)
     {
         if (_emojis[i] == null)
             _emojis[i] = new List<string>();
         foreach (var fileName in emojiPacks[i].GetFiles())
         {
             _emojis[i].Add(fileName.FullName.Replace(System.Web.HttpContext.Current.Request.PhysicalApplicationPath, string.Empty));
         }
     }
     _db = new BlogContext(ConfigurationManager.ConnectionStrings["BlogContext"].ConnectionString);
 }
 public HomeController(string connectionString)
 {
     Db = new BlogContext(connectionString);
 }
 public HomeController()
 {
     Db = new BlogContext(ConfigurationManager.ConnectionStrings["BlogContext"].ConnectionString);
 }
 public ActionResult Login(Member member)
 {
     if (ModelState.IsValid)
     {
         using (BlogContext db = new BlogContext(ConfigurationManager.ConnectionStrings["BlogContext"].ConnectionString))
         {
             string hashPass=EncryptString(member.Password,_passPhrase);
             var v = db.Members.FirstOrDefault(a => a.UserName.Equals(member.UserName) && a.Password.Equals(hashPass));
             if (v == null) return View(member);
             Session["LoggedUserID"] = v.UserId.ToString();
             Session["LoggedUserName"] = String.IsNullOrEmpty(v.NickName) ? v.UserName : v.NickName;
             return RedirectToAction("Index", "Dashboard");
         }
     }
     return View(member);
 }
 public ActionResult Signup( Member member)
 {
     if (ModelState.IsValid)
     {
         using (BlogContext db = new BlogContext(ConfigurationManager.ConnectionStrings["BlogContext"].ConnectionString))
         {
             member.UserId = null;
             member.IsActive = 1;
             member.Password=EncryptString(member.Password, _passPhrase);
             db.Members.Add(member);
             db.SaveChanges();
         }
         return Content("Congratulation ! New Member "+(String.IsNullOrEmpty(member.NickName) ? member.UserName : member.NickName)+". Please <b><a href='/Admin/Login'>Click Here to Login</a></b>");
     }
     else
     return View();
 }
 public GalleryController(BlogContext db)
 {
     _db = db;
 }
 public GalleryController()
 {
     _db = new BlogContext(ConfigurationManager.ConnectionStrings["BlogContext"].ConnectionString);
 }
 public DashBoardController(BlogContext db)
 {
     _db = db;
 }
 /*Test Userage*/
 public ArticleController(string connectionString)
 {
     _db = new BlogContext(connectionString);
 }