//
        // GET: /HistoryItem/Create
        public ActionResult Create()
        {
            apiController a = new apiController();
            ViewBag.cur1 = "USD/TRY: " + a.get("getlatest", "usd", "try");
            ViewBag.cur2 = "EUR/TRY: " + a.get("getlatest", "eur", "try");
            ViewBag.cur3 = "GBP/TRY: " + a.get("getlatest", "gbp", "try");

            return View();
        }
Exemple #2
0
        //
        // GET: /HistoryItem/Create

        public ActionResult Create()
        {
            apiController a = new apiController();

            ViewBag.cur1 = "USD/TRY: " + a.get("getlatest", "usd", "try");
            ViewBag.cur2 = "EUR/TRY: " + a.get("getlatest", "eur", "try");
            ViewBag.cur3 = "GBP/TRY: " + a.get("getlatest", "gbp", "try");

            return(View());
        }
        public ActionResult DeleteConfirmed(int id)
        {
            apiController a = new apiController();
            ViewBag.cur1 = "USD/TRY: " + a.get("getlatest", "usd", "try");
            ViewBag.cur2 = "EUR/TRY: " + a.get("getlatest", "eur", "try");
            ViewBag.cur3 = "GBP/TRY: " + a.get("getlatest", "gbp", "try");

            history history = db.history.Find(id);
            db.history.Remove(history);
            db.SaveChanges();
            return RedirectToAction("Index");
        }
Exemple #4
0
        //
        // GET: /HistoryItem/

        public ActionResult Index()
        {
            int           _userid = (Session["id"] != null) ? Convert.ToInt32(Session["id"].ToString()) : -1;
            apiController a       = new apiController();

            ViewBag.cur1 = "USD/TRY: " + a.get("getlatest", "usd", "try");
            ViewBag.cur2 = "EUR/TRY: " + a.get("getlatest", "eur", "try");
            ViewBag.cur3 = "GBP/TRY: " + a.get("getlatest", "gbp", "try");
            ForexHistoryEntities db          = new ForexHistoryEntities();
            List <history>       historyList = db.history.Where(x => x.userId == _userid).ToList();

            return(View(historyList));
        }
Exemple #5
0
        public ActionResult DeleteConfirmed(int id)
        {
            apiController a = new apiController();

            ViewBag.cur1 = "USD/TRY: " + a.get("getlatest", "usd", "try");
            ViewBag.cur2 = "EUR/TRY: " + a.get("getlatest", "eur", "try");
            ViewBag.cur3 = "GBP/TRY: " + a.get("getlatest", "gbp", "try");

            history history = db.history.Find(id);

            db.history.Remove(history);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        //
        // GET: /HistoryItem/Delete/5
        public ActionResult Delete(int id = 0)
        {
            int _userid = (Session["id"] != null) ? Convert.ToInt32(Session["id"].ToString()) : -1;
            apiController a = new apiController();
            ViewBag.cur1 = "USD/TRY: " + a.get("getlatest", "usd", "try");
            ViewBag.cur2 = "EUR/TRY: " + a.get("getlatest", "eur", "try");
            ViewBag.cur3 = "GBP/TRY: " + a.get("getlatest", "gbp", "try");

            history history = db.history.Find(id);
            if (history == null || history.userId!=_userid)
            {
                return HttpNotFound();
            }
            return View(history);
        }
Exemple #7
0
        //
        // GET: /HistoryItem/Edit/5

        public ActionResult Edit(int id = 0)
        {
            int           _userid = (Session["id"] != null) ? Convert.ToInt32(Session["id"].ToString()) : -1;
            apiController a       = new apiController();

            ViewBag.cur1 = "USD/TRY: " + a.get("getlatest", "usd", "try");
            ViewBag.cur2 = "EUR/TRY: " + a.get("getlatest", "eur", "try");
            ViewBag.cur3 = "GBP/TRY: " + a.get("getlatest", "gbp", "try");

            history history = db.history.Find(id);

            if (history == null || history.userId != _userid)
            {
                return(HttpNotFound());
            }
            return(View(history));
        }
        //
        // GET: /Forex/
        public ActionResult Index()
        {
            MemberController loginControl = new MemberController();
            string id = (Session["id"] != null) ? Session["id"].ToString() : "-1";
            string eMailAddress = (Session["eMailAddress"] != null) ? Session["eMailAddress"].ToString() : "INVALID";
            string password = (Session["password"] != null) ? Session["password"].ToString() : "INVALID";

            int nid=loginControl.isValidLogin(eMailAddress, password, false);
            if (id!="-1" && nid!=-1 && id==nid.ToString()){
                apiController a = new apiController();
                ViewBag.cur1 = "USD/TRY: " + a.get("getlatest", "usd", "try");
                ViewBag.cur2 = "EUR/TRY: " + a.get("getlatest", "eur", "try");
                ViewBag.cur3 = "GBP/TRY: " + a.get("getlatest", "gbp", "try");
                return View();
            }
            else return RedirectToAction("Index", "Home");
        }
        public ActionResult Create(history history)
        {
            apiController a = new apiController();
            ViewBag.cur1 = "USD/TRY: " + a.get("getlatest", "usd", "try");
            ViewBag.cur2 = "EUR/TRY: " + a.get("getlatest", "eur", "try");
            ViewBag.cur3 = "GBP/TRY: " + a.get("getlatest", "gbp", "try");

            string id = (Session["id"] != null) ? Session["id"].ToString() : "-1";
            int intId = Convert.ToInt32(id);
            history.userId = intId;
            history.result=a.get(history.date1, history.date2, history.cur1, history.cur2, history.amount);
            if (ModelState.IsValid)
            {
                db.history.Add(history);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(history);
        }
Exemple #10
0
        public ActionResult Edit(history history)
        {
            apiController a = new apiController();

            ViewBag.cur1 = "USD/TRY: " + a.get("getlatest", "usd", "try");
            ViewBag.cur2 = "EUR/TRY: " + a.get("getlatest", "eur", "try");
            ViewBag.cur3 = "GBP/TRY: " + a.get("getlatest", "gbp", "try");

            if (ModelState.IsValid)
            {
                string sid   = (Session["id"] != null) ? Session["id"].ToString() : "-1";
                int    intId = Convert.ToInt32(sid);
                history.userId = intId;

                db.Entry(history).State = EntityState.Modified;
                history.result          = a.get(history.date1, history.date2, history.cur1, history.cur2, history.amount);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            return(View(history));
        }
Exemple #11
0
        //
        // GET: /Forex/

        public ActionResult Index()
        {
            MemberController loginControl = new MemberController();
            string           id           = (Session["id"] != null) ? Session["id"].ToString() : "-1";
            string           eMailAddress = (Session["eMailAddress"] != null) ? Session["eMailAddress"].ToString() : "INVALID";
            string           password     = (Session["password"] != null) ? Session["password"].ToString() : "INVALID";

            int nid = loginControl.isValidLogin(eMailAddress, password, false);

            if (id != "-1" && nid != -1 && id == nid.ToString())
            {
                apiController a = new apiController();
                ViewBag.cur1 = "USD/TRY: " + a.get("getlatest", "usd", "try");
                ViewBag.cur2 = "EUR/TRY: " + a.get("getlatest", "eur", "try");
                ViewBag.cur3 = "GBP/TRY: " + a.get("getlatest", "gbp", "try");
                return(View());
            }
            else
            {
                return(RedirectToAction("Index", "Home"));
            }
        }
 //
 // GET: /HistoryItem/
 public ActionResult Index()
 {
     int _userid = (Session["id"] != null) ? Convert.ToInt32(Session["id"].ToString()) : -1;
     apiController a = new apiController();
     ViewBag.cur1 = "USD/TRY: " + a.get("getlatest", "usd", "try");
     ViewBag.cur2 = "EUR/TRY: " + a.get("getlatest", "eur", "try");
     ViewBag.cur3 = "GBP/TRY: " + a.get("getlatest", "gbp", "try");
     ForexHistoryEntities db = new ForexHistoryEntities();
     List<history> historyList = db.history.Where(x => x.userId == _userid).ToList();
     return View(historyList);
 }