| | |
| | | public class OpController : ApiController |
| | | { |
| | | [HttpGet] |
| | | public Model SelectById(int id) |
| | | public Model SelectById(long id) |
| | | { |
| | | return ModelDAL.SelectById(id); |
| | | try |
| | | { |
| | | return ModelDAL.SelectById(id); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | LogOut.Error(ex.StackTrace); |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | [HttpGet] |
| | | public int DeleteByIds([FromUri] List<long> ids) |
| | | { |
| | | try |
| | | { |
| | | if (null == ids || ids.Count == 0) return 0; |
| | | |
| | | return ModelDAL.DeleteByIds(ids); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | LogOut.Error(ex.StackTrace); |
| | | return 0; |
| | | } |
| | | } |
| | | |
| | | [HttpPost] |
| | | public int insert([FromBody] Model model) |
| | | { |
| | | try |
| | | { |
| | | if (null == model) return 0; |
| | | |
| | | return ModelDAL.insert(model); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | LogOut.Error(ex.StackTrace); |
| | | return 0; |
| | | } |
| | | } |
| | | |
| | | [HttpPost] |
| | | public int UpdateById([FromBody] Model model) |
| | | { |
| | | try |
| | | { |
| | | if (null == model) return 0; |
| | | |
| | | return ModelDAL.UpdateById(model); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | LogOut.Error(ex.StackTrace); |
| | | return 0; |
| | | } |
| | | } |
| | | } |
| | | } |