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)); }
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); }
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; }
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)); }
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(); }
public TermDetailModel(IContentPage ui, TermSummary term) : base(ui) { this.Term = term; this.LoadTermDetails(); }
public TermEditor(TermSummary term) { InitializeComponent(); this.BindingContext = new TermEditorModel(this, term); }
public TermDetail(TermSummary term) { InitializeComponent(); this.BindingContext = new TermDetailModel(this, term); }