Ejemplo n.º 1
0
        // 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)));
            }
        }
Ejemplo n.º 2
0
        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());
        }
Ejemplo n.º 3
0
        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)));
            }
        }
Ejemplo n.º 4
0
        // 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)));
            }
        }
Ejemplo n.º 5
0
        // 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)));
            }
        }
Ejemplo n.º 6
0
 public static int KwEdit(LocationManagement lo)
 {
     return(DAL.LL.KweiGuanli.KwEdit(lo));
 }
Ejemplo n.º 7
0
 public static int add(LocationManagement lo)
 {
     return(DAL.LL.KweiGuanli.add(lo));
 }
Ejemplo n.º 8
0
 public static int add(LocationManagement lo)
 {
     s.LocationManagement.Add(lo);
     return(s.SaveChanges());
 }
Ejemplo n.º 9
0
 public ActionResult KWAdd(LocationManagement lo)
 {
     lo.Shuju     = true;
     lo.Isdefault = 2;
     return(Json(BLL.LL.KweiGuanliManager.add(lo), JsonRequestBehavior.AllowGet));
 }