Esempio n. 1
0
        public TermSummary SaveTerm([FromBody] TermSummary term)
        {
            var termMgr = Dependency.Resolve <ITermManager>();

            // Save term
            return(termMgr.SaveTerm(term.TermID, term.TermName, term.TermStart, term.TermEnd, term.BondAmount, term.CasualRate, term.IncludeOrganizer, null));
        }
Esempio n. 2
0
        public async Task GetActiveTerm()
        {
            var termMgr  = new TermManager();
            var termList = await termMgr.GetTerms(null);

            // There will always only be just one active term
            this.ActiveTerm = termList.FirstOrDefault(x => x.IsActive);
        }
Esempio n. 3
0
 public TermEditorModel(IContentPage ui, TermSummary term) : base(ui)
 {
     if (term == null)
     {
         // Set defaults
         term           = new TermSummary();
         term.TermStart = DateTime.Now;
         term.TermEnd   = DateTime.Now;
     }
     this.Term = term;
 }
Esempio n. 4
0
        public TermSummary SaveTerm(int termID, [FromBody] TermSummary term)
        {
            term.TermID = termID;
            // We now need to check if the term exists first...
            var existingTerm = Dependency.Resolve <ITermManager>().GetTerm(term.TermID);

            if (existingTerm == null)
            {
                throw new UserException("The term could not be retrieved from the datastore ");
            }
            return(this.SaveTerm(term));
        }
Esempio n. 5
0
        public async Task SaveTerm(TermSummary term)
        {
            BaseAPI <Task> api = new BaseAPI <Task>();

            api.RelativeUrl = "term/saveterm";
            api.ParameterDictionary.Add("TermID", term.TermID.ToString());
            api.ParameterDictionary.Add("TermName", term.Name);
            api.ParameterDictionary.Add("TermStart", term.TermStart.ToString());
            api.ParameterDictionary.Add("TermEnd", term.TermEnd.ToString());
            api.ParameterDictionary.Add("BondAmount", term.BondAmount.ToString());
            api.ParameterDictionary.Add("CasualRate", term.CasualRate.ToString());
            api.ParameterDictionary.Add("IncludeOrganizer", term.IncludeOrganizer.ToString());
            api.ParameterDictionary.Add("IsDeleted", false.ToString());
            api.ParameterDictionary.Add("IsActive", false.ToString());
            api.ParameterDictionary.Add("IsInvoiced", term.IsInvoiced.ToString());
            await api.GetAsync();
        }
Esempio n. 6
0
 public TermDetailModel(IContentPage ui, TermSummary term) : base(ui)
 {
     this.Term = term;
     this.LoadTermDetails();
 }
Esempio n. 7
0
 public TermEditor(TermSummary term)
 {
     InitializeComponent();
     this.BindingContext = new TermEditorModel(this, term);
 }
Esempio n. 8
0
 public TermDetail(TermSummary term)
 {
     InitializeComponent();
     this.BindingContext = new TermDetailModel(this, term);
 }