Ejemplo n.º 1
0
        public static List<BillDTO> GetBillByAccountID(string ID)
        {
            List<BillDTO> kq = new List<BillDTO>();

            string query = "select * from db3c04c35a9c6b45918ba3a551005e16ee.bill where AccountID like '" + ID + "'";

            DataTable dt = DataProvider.ExecuteQuery(query);

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                BillDTO bill = new BillDTO();

                bill.AccountID = (string)dt.Rows[i]["AccountID"];
                bill.Price = (int)dt.Rows[i]["Price"];
                bill.Date = (string)dt.Rows[i]["Date"];
                bill.Validated = (string)dt.Rows[i]["Validated"];

               kq.Add(bill);
            }

            return kq;
        }
Ejemplo n.º 2
0
        public static void SaveBill(BillDTO dto)
        {
            string query = "insert into db3c04c35a9c6b45918ba3a551005e16ee.bill "
                            + "value ('" + dto.AccountID + "','" + dto.Price + "','" + dto.Date  + "','" + dto.Validated + "')";

            if (DataProvider.ExecuteNonQuery(query))
            {

            }
            else
            {

            }
        }
Ejemplo n.º 3
0
        public ActionResult TradeSuccess()
        {
            string id = "";

            if (Request.Cookies.AllKeys.Contains("userID"))
            {
                id = Request.Cookies["userID"].Value;

            }

            if (Request["userID"] != null)
            {
                id = Request["userID"];
            }

            string price = Request["Price"];

            BillDTO dto = new BillDTO();
            dto.AccountID = id;
            dto.Price = int.Parse(price);
            dto.Date = DateTime.Now.ToString();
            dto.Validated = "not";

            TradeDAO.SaveBill(dto);

            ViewBag.userID = id;

            var userCookie = new HttpCookie("userID", id);
            userCookie.Expires.AddHours(1);
            HttpContext.Response.Cookies.Add(userCookie);

            return View();
        }