示例#1
0
        public IHttpActionResult PutKpi(int id, KpiType kpi)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            if (id != kpi.KpiTypeID)
            {
                return BadRequest();
            }

            db.Entry(kpi).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!KpiExists(id))
                {
                    return NotFound();
                }
                else
                {
                    throw;
                }
            }

            return StatusCode(HttpStatusCode.NoContent);
        }
示例#2
0
        public IHttpActionResult PostKpiType(KpiType kpi)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            db.KpiTypes.Add(kpi);
            db.SaveChanges();

            return CreatedAtRoute("DefaultApi", new { id = kpi.KpiTypeID }, kpi);
        }
示例#3
0
 public KpiCriteria(string _criteriaName, int _value, KpiType _type)
 {
     criteriaName = _criteriaName;
     value = _value;
     type = _type;
 }
示例#4
0
文件: Kpi.cs 项目: TicoSource/Eval
 public Kpi(KpiType _type)
 {
     type = _type;
     criteria = new HashSet<KpiCriteria>();
 }