Esempio n. 1
0
 public List <spCommodityHistory_Result> GetAll()
 {
     using (var db = new PDPEntities())
     {
         return(db.spCommodityHistory().ToList());
     }
 }
Esempio n. 2
0
 public List <Extract_LU> GetAll()
 {
     using (var db = new PDPEntities())
     {
         return(db.Extract_LU.ToList());
     }
 }
Esempio n. 3
0
 public List<ConUnit_LU> GetAll()
 {
     using (var db = new PDPEntities())
     {
         return db.ConUnit_LU.ToList();
     }
 }
Esempio n. 4
0
 public List <State_LU> GetAll()
 {
     using (var db = new PDPEntities())
     {
         return(db.State_LU.ToList());
     }
 }
Esempio n. 5
0
 public List <spPesticideHistory_Result> GetAll()
 {
     using (var db = new PDPEntities())
     {
         return(db.spPesticideHistory().ToList());
     }
 }
Esempio n. 6
0
 public List <Commod_LU> GetAll()
 {
     using (var db = new PDPEntities())
     {
         return(db.Commod_LU.ToList());
     }
 }
Esempio n. 7
0
 public List <PestCode_LU> GetAll()
 {
     using (var db = new PDPEntities())
     {
         return(db.PestCode_LU.ToList());
     }
 }
Esempio n. 8
0
 public List <TestClass_LU> GetAll()
 {
     using (var db = new PDPEntities())
     {
         return(db.TestClass_LU.ToList());
     }
 }
Esempio n. 9
0
 public List <Determin_LU> GetAll()
 {
     using (var db = new PDPEntities())
     {
         return(db.Determin_LU.ToList());
     }
 }
Esempio n. 10
0
 public List <spToleranceLevel_Result> GetAll()
 {
     using (var db = new PDPEntities())
     {
         return(db.spToleranceLevel().ToList());
     }
 }
Esempio n. 11
0
 public List <DistType_LU> GetAll()
 {
     using (var db = new PDPEntities())
     {
         return(db.DistType_LU.ToList());
     }
 }
Esempio n. 12
0
        //public CountryController()
        //{

        //}

        public List <Country_LU> GetAll()
        {
            using (var db = new PDPEntities())
            {
                db.Configuration.ProxyCreationEnabled = false;
                return(db.Country_LU.ToList());
            }
        }
Esempio n. 13
0
 public List <telecom_order> GetAll()
 {
     using (var db = new PDPEntities()) {
         return(db.telecom_order.ToList());
     }
 }
Esempio n. 14
0
        public IHttpActionResult PutCellEdit([FromBody] EditCellReq req)
        {
            if (string.IsNullOrEmpty(req.rowkey))
            {
                return(BadRequest("req.rowkey is empty"));
            }
            using (var db = new PDPEntities()) {
                short  iPdpYear;
                int    iSamplePk;
                double dVal;
                var    asRowId = req.rowkey.Split('|');
                if (asRowId.Length != 4)
                {
                    return(BadRequest("Invalid number of columns in the key: " + asRowId.Length));
                }
                //SAMPLE_PK int, PESTCODE string, PDP_YEAR short, COMMOD string
                if (!int.TryParse(asRowId[0], out iSamplePk))
                {
                    return(BadRequest("Invalid value for SamplePK:" + asRowId[0]));
                }
                if (!short.TryParse(asRowId[2], out iPdpYear))
                {
                    return(BadRequest("Invalid value for Pdp year:" + asRowId[2]));
                }

                var foundRec = db.ResultsDatas.Find(new object[] { iSamplePk, asRowId[1], iPdpYear, asRowId[3] });
                if (null == foundRec)
                {
                    return(BadRequest("record with the key {0} was not found"));
                }
                switch (req.col)
                {
                case "Concen":
                    if (!double.TryParse(req.val, out dVal))
                    {
                        return(BadRequest("Value of CONCEN can't be " + req.val));
                    }
                    foundRec.CONCEN = dVal; break;

                case "LOD":
                    if (!double.TryParse(req.val, out dVal))
                    {
                        return(BadRequest("Value of LOD can't be " + req.val));
                    }
                    foundRec.LOD = dVal; break;

                case "pp_":
                    foundRec.CONUNIT = req.val; break;

                default: return(BadRequest("can't edit column " + req.col));
                }
                try {
                    db.SaveChanges();
                }catch (Exception ex) {
                    Logger.Error(ex);
                    while (null != ex.InnerException)
                    {
                        ex = ex.InnerException;
                    }
                    return(InternalServerError(ex));
                }
            }
            return(Ok());
        }