Esempio n. 1
0
        public JsonResult GetTrackerEntries(DataTableParams dtParams)
        {
            Session currentSession = Helpers.AuthenticationHelper.GetSession(System.Web.HttpContext.Current);

            BusinessLibrary.Library.CurrencyConversionTrackerLibrary ctLib = new BusinessLibrary.Library.CurrencyConversionTrackerLibrary(System.Web.HttpContext.Current, currentSession);
            return(Json(ctLib.GetTrackerListForUser(dtParams).EntryListDataTable, JsonRequestBehavior.AllowGet));
        }
Esempio n. 2
0
        public JsonResult DeleteAllEntries()
        {
            Session currentSession = Helpers.AuthenticationHelper.GetSession(System.Web.HttpContext.Current);

            BusinessLibrary.Library.CurrencyConversionTrackerLibrary ctLib = new BusinessLibrary.Library.CurrencyConversionTrackerLibrary(System.Web.HttpContext.Current, currentSession);
            try
            {
                ctLib.DeleteAllEntriesForUser();
                return(Json(new { StatusKey = "SUCCESS" }));
            }
            catch
            {
                return(Json(new { StatusKey = "ERROR" }));
            }
        }
Esempio n. 3
0
        public JsonResult DeleteEntry(BusinessLibrary.UIRequestClasses.TrackerUpdateRequest entryRowObject)
        {
            Session currentSession = Helpers.AuthenticationHelper.GetSession(System.Web.HttpContext.Current);

            BusinessLibrary.Library.CurrencyConversionTrackerLibrary ctLib = new BusinessLibrary.Library.CurrencyConversionTrackerLibrary(System.Web.HttpContext.Current, currentSession);
            try
            {
                ctLib.DeleteEntry(entryRowObject.entryID);
                return(Json(new { StatusKey = "SUCCESS", rowID = entryRowObject.rowID }));
            }
            catch
            {
                return(Json(new { StatusKey = "ERROR", rowID = entryRowObject.rowID }));
            }
        }
Esempio n. 4
0
        public JsonResult SaveNewTrackerEntry(ConversionTrackerViewModel tvm)
        {
            Session currentSession = Helpers.AuthenticationHelper.GetSession(System.Web.HttpContext.Current);

            if (tvm.EntryName == null)
            {
                tvm.EntryName = "";
            }

            BusinessLibrary.Library.CurrencyConversionTrackerLibrary ctLib = new BusinessLibrary.Library.CurrencyConversionTrackerLibrary(System.Web.HttpContext.Current, currentSession);
            try
            {
                ctLib.SaveNewEntry(tvm);
                return(Json(new { StatusKey = "SUCCESS" }));
            }
            catch
            {
                return(Json(new { StatusKey = "ERROR" }));
            }
        }