// GET: api/Account/5 public IHttpActionResult Get(string id) { try { var accMng = new LocationManagement(); var location = new Location { IdLocation = id }; location = accMng.RetrieveById(location); apiResponse = new ApiResponse(); apiResponse.Data = location; return(Ok(apiResponse)); } catch (BusinessException bex) { return(InternalServerError(new Exception(bex.ExceptionId + "--" + bex.AppMessage.Message))); } }
public static int KwEdit(LocationManagement lo) { var obj = (from p in s.LocationManagement where p.kwID == lo.kwID select p).First(); obj.kwName = lo.kwName; obj.kwType = lo.kwType; obj.CangKu = lo.CangKu; obj.Zhuangtai = lo.Zhuangtai; obj.Time = lo.Time; return(s.SaveChanges()); }
public IHttpActionResult Get() { try { var accMng = new LocationManagement(); apiResponse = new ApiResponse(); apiResponse.Data = accMng.RetrieveAll(); return(Ok(apiResponse)); } catch (BusinessException bex) { return(InternalServerError(new Exception(bex.ExceptionId + "--" + bex.AppMessage.Message))); } }
// PUT: api/Account/5 public IHttpActionResult Put(Location location) { try { var accMng = new LocationManagement(); accMng.Update(location); apiResponse.Message = "Location updated"; return(Ok(apiResponse)); } catch (BusinessException bex) { return(InternalServerError(new Exception(bex.ExceptionId + "--" + bex.AppMessage.Message))); } }
// DELETE: api/Account/5 public IHttpActionResult Delete(string id) { try { var accMng = new LocationManagement(); var location = new Location { IdLocation = id }; accMng.Delete(location); apiResponse = new ApiResponse(); apiResponse.Message = "Location Deleted"; return(Ok(apiResponse)); } catch (BusinessException bex) { return(InternalServerError(new Exception(bex.ExceptionId + "--" + bex.AppMessage.Message))); } }
public static int KwEdit(LocationManagement lo) { return(DAL.LL.KweiGuanli.KwEdit(lo)); }
public static int add(LocationManagement lo) { return(DAL.LL.KweiGuanli.add(lo)); }
public static int add(LocationManagement lo) { s.LocationManagement.Add(lo); return(s.SaveChanges()); }
public ActionResult KWAdd(LocationManagement lo) { lo.Shuju = true; lo.Isdefault = 2; return(Json(BLL.LL.KweiGuanliManager.add(lo), JsonRequestBehavior.AllowGet)); }