コード例 #1
0
ファイル: CropController.cs プロジェクト: yoavShaked/NegevApp
        public IHttpActionResult DeleteCrop(int i_CropID)
        {
            using (EntitiesNegev4 context = new EntitiesNegev4())
            {
                IHttpActionResult response = Ok();
                bool ok = true;

                try
                {
                    m_CropHendler.DeleteRow(i_CropID, context);
                }
                catch
                {
                    response = StatusCode(System.Net.HttpStatusCode.ServiceUnavailable);
                    ok       = false;
                }
                if (ok)
                {
                    List <ILightWeight> cropToSend = m_CropHendler.GetAllTable(context) as List <ILightWeight>;
                    response = Ok(cropToSend);
                }

                return(response);
            }
        }
コード例 #2
0
        public IHttpActionResult DeleteCrop(int i_CropID)
        {
            using (EntitiesNegev4 context = new EntitiesNegev4())
            {
                IHttpActionResult response = Ok();

                try
                {
                    m_CropHendler.DeleteRow(i_CropID, context);
                }
                catch
                {
                    response = BadRequest("could not delete...");
                }

                return(response);
            }
        }