public static GEAContextView HandlerClassification(GEAContext db, NameValueCollection parms) { GEAContextView rc = db.GetViewContext(VIEWNAME) as GEAContextView; if (rc == null) { db.SaveViewContext(GEAContextView.VIEWNAME, rc = new GEAContextView()); } string menuitem = parms["menuitem"]; if (menuitem != null) { if (menuitem.Equals("Report.Save")) { rc.Regim = REGIM.SAVE; } } else if (rc.ecoevolution != null) { rc.Regim = REGIM.REPORT; rc.ecoclassifiation = new GEAContext.ECOClassification(rc.ecoevolution); } return(rc); }
public static GEAContextView HandlerChoice(GEAContext db, NameValueCollection parms) { GEAContextView rc = db.GetViewContext(VIEWNAME) as GEAContextView; if (rc == null) { db.SaveViewContext(GEAContextView.VIEWNAME, rc = new GEAContextView()); } string menuitem = parms["menuitem"]; if (menuitem != null) { if (menuitem.Equals("ChoiceEvalutionResult.Choice")) { rc.Regim = REGIM.CHOICE; if (!string.IsNullOrEmpty(parms["ChoiceEvalutionResult.id"])) { int id = 0; if (int.TryParse(parms["ChoiceEvalutionResult.id"], out id)) { rc.ecoevolution = CEQContext.ECOEvalution.GetById(db, id); } else { rc.ecoevolution = null; } } } else if (menuitem.Equals("ChoiceEvalutionResult.Cancel")) { rc.Regim = REGIM.CANCEL; } } else { rc.Regim = REGIM.INIT; } return(rc); }