public ActionResult Create(MemberGroups model)
        {
            try
            {
                model.Createdon = DateTime.Now;
                model.Modifiedon = DateTime.Now;
                // TODO: Add insert logic here
                Data.Helper.NHibernateHelper.Save<MemberGroups>(model);

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
        public ActionResult Update(MemberGroups model)
        {
            try
            {
                // TODO: Add update logic here
                MemberGroups itm = Data.Helper.NHibernateHelper.UniqueResult<MemberGroups>(null, "Id", model.Id);

                if (itm.OwnerId != LoggedInUserKey)
                {
                    TempData["message"] = "You do not have Edit access to the requested group. Activity Logged.";
                    Data.Helper.NHibernateHelper.Log(new Exception("Hacking Attempt!!! User: "******", Group Id: " + itm.Id));
                    return RedirectToAction("Index");
                }

                itm = AutoMapper.Mapper.Map(model, itm);
                itm.OwnerId = LoggedInUserKey;

                Data.Helper.NHibernateHelper.Update<MemberGroups>(itm);
                TempData["message"] = "The requested group is updated now.";
            }
            catch (Exception excp)
            {
                TempData["message"] = "Error Updating the group: " + excp.Message + excp.StackTrace;
            }
            return RedirectToAction("Index");
        }