public List<EventClassParameterViewModel> GetContractParameter(int CRef, string PID)
        {
            List<EventClassParameterViewModel> ret = new List<EventClassParameterViewModel>();

            var qry = db.CustomerContract.Where(x => x.CustomerRef == CRef && x.ProductID == PID);
            foreach (CustomerContract o in qry)
            {
                EventClassParameterViewModel s = new EventClassParameterViewModel();
                
                //s.EventClass = "";                
                s.SugArriveMin = o.CallToArrivalRangeTime.Value;
                s.SugFinishMin = o.CallToRepairRangeTime.Value;

                ret.Add(s);
            }

            return ret;
        }
        public List<EventClassParameterViewModel> GetEventClassParameter()
        {
            List<EventClassParameterViewModel> ret = new List<EventClassParameterViewModel>();

            var qry = db.SystemSetting.Where(x => x.Seq != 0);
            foreach (SystemSetting o in qry)
            {
                EventClassParameterViewModel s = new EventClassParameterViewModel();

                if (o.isSysDefault == true)
                    s.EventClass = "Default";
                else
                    s.EventClass = o.EventClass;                
                s.SugArriveMin = o.SugArriveMin;
                s.SugFinishMin = o.SugFinishMin;
                s.AssignUserType = o.AssignUserType;
                ret.Add(s);
            }

            return ret;
        }