Beispiel #1
0
        public ActionResult buy(int id_tovar,int id_user)
        {
            try
            {
                if (String.Compare(id_user.ToString(), Session["user_id"].ToString()) == 0)
                {

                    Models.User usr = new Models.User();

                    ViewData["Message"] = "Товар Куплен! " + usr.doBuyItem(id_user, id_tovar); ;

                }
                return View("BlogIndex");
            }
            catch
            {
                return View("BlogIndex");

            }
        }
Beispiel #2
0
 public String doBuy(int id_tovar)
 {
     try
     {
         if (id_tovar == null) return "0";
         if (this.CheckAuth() != "1") return "0";
         int id_user = Convert.ToInt32(Session["user_id"]);
         Models.User usr = new Models.User();
         return usr.doBuyItem(id_user, id_tovar);
     }
     catch
     {
         return "Произошла ошибка!";
     }
 }