예제 #1
0
        //public static CEQViewContext HandlerEvalutionForecast(CEQContext db, NameValueCollection parms)
        //{
        //     CEQViewContext rc = db.GetViewContext(VIEWNAME) as CEQViewContext;

        //     if ((rc = db.GetViewContext(VIEWNAME) as CEQViewContext) != null)
        //     {
        //        rc.RegimEvalution =  rc.RegimEvalution == REGIM_EVALUTION.CANCEL? REGIM_EVALUTION.INIT: rc.RegimEvalution;
        //        string menuitem = parms["menuitem"];
        //        if (menuitem != null)
        //        {
        //            if       (menuitem.Equals("CEQReport.Save"))    rc.RegimEvalution = REGIM_EVALUTION.SAVE;
        //            else  if (menuitem.Equals("CEQReport.Cancel"))  rc.RegimEvalution = REGIM_EVALUTION.CANCEL;
        //        }
        //     }
        //     return rc;
        //}

        public static CEQViewContext  HandlerChoiceForecast(CEQContext db, NameValueCollection parms)
        {
            CEQViewContext rc = null;

            if ((rc = db.GetViewContext(VIEWNAME) as CEQViewContext) != null)
            {
                rc.RegimChoice = REGIM_CHOICE.INIT;
                string menuitem = parms["menuitem"];
                if (menuitem != null)
                {
                    if (menuitem.Equals("ChoiceForecastResult.Choice"))
                    {
                        string formid = parms["ChoiceForecastResult.id"];
                        int    id     = -1;
                        if (!string.IsNullOrEmpty(formid) && int.TryParse(formid, out id))
                        {
                            rc.idforecat = id;
                            EGH01DB.RGEContext.ECOForecast ef = rc.ecoforecat = null;
                            string comment = string.Empty;
                            if (EGH01DB.RGEContext.ECOForecast.GetById(db, id, out ef, out comment))
                            {
                                rc.ecoforecat  = ef;
                                rc.RegimChoice = REGIM_CHOICE.CHOICE;
                            }
                            else
                            {
                                rc.RegimChoice = REGIM_CHOICE.ERROR;
                            }
                        }
                        else
                        {
                            rc.RegimChoice = REGIM_CHOICE.ERROR;
                        }
                    }
                    else if (menuitem.Equals("ChoiceForecastResult.Cancel"))
                    {
                        rc.RegimChoice = REGIM_CHOICE.CANCEL;
                    }
                    else if (menuitem.Equals("ConfirmChoiceForecastResult.Confirm"))
                    {
                        rc.RegimChoice = REGIM_CHOICE.REPORT;
                    }
                    else if (menuitem.Equals("ConfirmChoiceForecastResult.Cancel"))
                    {
                        rc.RegimChoice = REGIM_CHOICE.INIT;
                    }
                    else if (menuitem.Equals("CEQReport.Save"))
                    {
                        rc.RegimChoice = REGIM_CHOICE.SAVE;
                    }
                    else if (menuitem.Equals("CEQReport.Cancel"))
                    {
                        rc.RegimChoice = REGIM_CHOICE.CANCEL;
                    }
                }
            }

            return(rc);
        }
예제 #2
0
        public static CEQViewContext HandlerEvalutionForecast(CEQContext db, NameValueCollection parms)
        {
            CEQViewContext rc = db.GetViewContext(VIEWNAME) as CEQViewContext;

            if ((rc = db.GetViewContext(VIEWNAME) as CEQViewContext) != null)
            {
                rc.RegimEvalution = rc.RegimEvalution == REGIM_EVALUTION.CANCEL? REGIM_EVALUTION.INIT: rc.RegimEvalution;
                string menuitem = parms["menuitem"];
                if (menuitem != null)
                {
                    if (menuitem.Equals("Report.Save"))
                    {
                        rc.RegimEvalution = REGIM_EVALUTION.SAVE;
                    }
                    else if (menuitem.Equals("Report.Cancel"))
                    {
                        rc.RegimEvalution = REGIM_EVALUTION.CANCEL;
                    }
                }
            }
            return(rc);
        }