public void SendDeadReport(int UserId, User FatherInfo)
 {
     var mailer = new DefaultMailer();
     var w = new OwnersByRecipientQuery(UserId, FatherInfo.Id).ExecuteNew2();
     for (int i = 0; i < w.Count; i++)
     {
         var msg = mailer.SendWitnessDeadReport(FatherInfo.FullName(), w[i].FirstName + " " + w[i].LastName, w[i].Email);
         msg.Send();
     }
 }
        public ActionResult AddRecipient()
        {
            var user = Current.User;
            var ownerRecipient = new OwnersByRecipientQuery(user.Id).ExecuteNew();
            //var ownerRecipient = Current.Connection.Get<User>(Current.UserId);
            //if (ownerRecipient != null)
            //{
            //    var recipient = Current.Connection.Get<User>(ownerRecipient.Id);
            //    var model = Mapper.Map<RecipientAddModel>(recipient);
            //    return View(model);
            //}
            return this.View(ownerRecipient);

            //var recipient = new List<RecipientAddModel>
            //    {
            //        new RecipientAddModel()
            //    };
            //return View(recipient);
        }
 //[HttpPost]
 //public ActionResult Index(OwnerByRecipientModel dataheir)
 //{
 //    var getOwner = new DataheirAddHandler().FindIdOwner(Current.UserId);
 //    var userFather = new DataheirAddHandler().FindFatherInfo(getOwner.UserIdFather.Value);
 //    var sent = new DataheirAddHandler();
 //    sent.SendDeadReport(getOwner.UserIdFather.Value, userFather);
 //    return RedirectToAction("Message", "Recipient");
 //}
 public ActionResult Message()
 {
     var owners = new OwnersByRecipientQuery(Current.UserId).Execute1();
     return View(owners);
 }
 public ActionResult Index()
 {
     var owners = new OwnersByRecipientQuery(Current.UserId).Execute();
     Session["username"] = Current.User.UserName;
     return View(owners);
 }