Exemplo n.º 1
0
 static dal.linq.Merchant GetMerchant(int? id, MerchantDao dao)
 {
     if (id == null)
       {
      // Id is required
      return null;
       }
       var identity = System.Web.HttpContext.Current.User.Identity;
       if (identity.IsAuthenticated && id.ToString() != identity.Name)
       {
      // Unable to see other profile
      return null;
       }
       var m = dao.Get(id.Value);
       return m;
 }
Exemplo n.º 2
0
 public ActionResult Index(int? id)
 {
     var dao = new MerchantDao();
      if (id != null)
      {
     var m = dao.Get(id.Value);
     if (m != null)
     {
        if (!m.Confirmed)
        {
           // Confirmation
           m.Confirmed = true;
           dao.Update(m);
           ViewBag.isConfirmation = true;
        }
        ViewBag.email = m.Email;
     }
      }
      return View();
 }