
# appapi/apporder (報名管理)

### 介面
``` C#
public class apporderController : ApiController
```
## Get()
### 介面    
```
    // GET appapi/<controller>
    public IEnumerable<Model.pro_order> Get()
```
取得全部報名資料列表
### 傳回
``` C#
    IEnumerable<Model.pro_order>
```
### 介面
``` C#    
    public IEnumerable<Model.pro_order> Get(int page, int pageSize = 10, 
        string sortBy="", bool sortDesc=false)
```
取得指定分頁報名資料列表
### 傳回
``` C#
    IEnumerable<Model.pro_order>
```
### 介面
``` C#    
    // GET appapi/<controller>/5
    public Model.pro_order Get(string id)
```
取得指定ID(報名編號)分頁報名

### 傳回
``` C#
    Model.pro_order
```
## Post()
### 介面
``` C#    
    // POST appapi/<controller>
    public void Post([FromBody] Model.pro_order item)
```
新增報名資料

### 傳回
``` C#
    void
```
## Put()
### 介面
``` C#    
    // PUT appapi/<controller>/5
    public void Put(int id, [FromBody] Model.pro_order item)
```
修改報名資料

### 傳回
``` C#
    
```
## Delete()
### 介面
``` C#    
    // DELETE appapi/<controller>/5
    public void Delete(string id)
```
刪除指定ID(報名編號)報名資料(主檔)

### 傳回
``` C#
    
```
## [HttpDelete] api/apporder/DeleteItem/{id}
### 介面
``` C#    
    [HttpDelete]
    [Route("api/apporder/DeleteItem/{id}")]
    public void DeleteDetail(int id) //刪除訂單明細
```
刪除指定ID(報名編號)報名資料(明細)

### 傳回
``` C#
    
```
## [HttpDelete] api/apporder/DeleteAll/{nums}
### 介面
``` C#    
    [HttpDelete]
    [Route("api/apporder/DeleteAll/{nums}")]
    public void DeleteAll(string nums)
```
刪除指定ID(報名編號)報名資料(整筆)

### 傳回
``` C#
    
```
## [HttpGet] api/apporder/count
### 介面
``` C#    
    [HttpGet]
    [Route("api/apporder/count")]
    public int Count()
```
傳回筆數

### 傳回
``` C#
    int
```
## [HttpPost] api/apporder/GetList
### 介面
``` C#    
    [HttpPost]
    [Route("api/apporder/GetList")]
    public IHttpActionResult GetList([FromBody] Model.ViewModel.pro_order q, 
        int page, int pageSize = 10,
        string sortBy = "", bool sortDesc = false)
```
對報名資料:分頁查詢, 排序, 傳回列表

### 傳回
``` C#
    {
        list = IEnumerable<Model.pro_order>, //分頁列表
        count = int //筆數
    }    
```

## [HttpPost] api/apporder/GetItemList
### 介面
``` C#    
    [HttpPost]
    [Route("api/apporder/GetItemList")]
    public IHttpActionResult GetItemList(
        [FromBody] Model.ViewModel.pro_order_detail q, 
        int page, int pageSize = 10,
        string sortBy = "", bool sortDesc = false)
```
取得報名明細
### 傳回
``` C#
    new{
        list = List of pro_order_detail
        count = int
    }
``` 

## [HttpPost] api/apporder/SaveDetailData
### 介面
``` C#    
    [HttpPost]
    [Route("api/apporder/SaveDetailData")]
    public IHttpActionResult SaveDetailData([FromBody] Model.pro_order_detail item)
```
儲存報名明細
### 傳回
``` C#
    new
    {
        num = order.num,
        customize_data = order.customize_data,
    }
```
## [HttpPost] api/apporder/GetUnpayList
### 介面
``` C#    
    [HttpPost]
    [Route("api/apporder/GetUnpayList")]
    public IHttpActionResult GetUnpayList([FromBody] Model.ViewModel.follower q, 
        string order_no , int page, int pageSize = 10,
        string sortBy = "", bool sortDesc = false)
```
傳回未付款的訂單列表
### 傳回
``` C#
    new
    {
        list = List of new
        {
            id ,
            order_no ,
            up_time ,
            reg_time ,
            f_num ,
            u_name ,
            totalPrice , //訂單金額
            payPrice = , //已收金額
        }),
        count = orderDt.Count(),
    }    
```
## [HttpPost] api/apporder/GetUnpayDetail
### 介面
``` C#    
    [HttpPost]
    [Route("api/apporder/GetUnpayDetail")]
    public IHttpActionResult GetUnpayDetail([FromBody] Model.ViewModel.pro_order q,
            int page, int pageSize = 10,
            string sortBy = "", bool sortDesc = false)
```
傳回未付款的訂單明細
### 傳回
``` C#
    new {
        list = List of new {
            id,
            order_no,
            actItem_num,
            actItem_numTxt,              
            f_num,
            u_name,
            price, //訂單金額
            pay, //已收金額

        },
        count = unpayDt.Count(),
    }
```
## 
### 介面
``` C#    
    [HttpGet]
    [Route("api/apporder/printFileLog/{num}/{detail}")]
    public IHttpActionResult printFileLog(int num , int detail)
```
更新已列印記錄
### 傳回
``` C#
    order.printed_files //已列印記錄
```
## [HttpPost] api/apporder/printMultiFileLog
### 介面
``` C#    
    [HttpPost]
    [Route("api/apporder/printMultiFileLog")]
    public IHttpActionResult printMultiFileLog([FromBody] List<int> list, 
        int item, int file)
```
更新多筆列印記錄
### 傳回
``` C#
    
```
## [HttpGet] api/apporder/copyDetailData/{num}/{qty}
### 介面
``` C#    
    [HttpGet]
    [Route("api/apporder/copyDetailData/{num}/{qty}")]
    public IHttpActionResult copyDetailData(int num, int qty)
```
複製指定的報名項目
### 傳回
``` C#
    
```
## [HttpPost] api/apporder/GetPastOrderList
### 介面
``` C#    
    [HttpPost]
    [Route("api/apporder/GetPastOrderList")]
    public IHttpActionResult GetPastOrderList([FromBody] Model.pro_order q, 
        int page, int pageSize = 10,
        string sortBy = "", bool sortDesc = false)
```
複製以往報名
### 傳回
``` C#
    new
    {
        list = List of new
        {
            id,
            num,
            order_no,
            up_time,
            activity_selected = new
            {
                text,
                val,
            },
            actitem_num_selected = new
            {
                text,
                val,
            },
        }),
        count = qry.Count(),
    }
``` 
<!-- 
-->

## [HttpPost] api/apporder/copyMultiPastItem
### 介面
``` C#    
    [HttpPost]
    [Route("api/apporder/copyMultiPastItem")]
    public IHttpActionResult copyMultiPastItem([FromBody] List<int> list,
        string order_no)
```
複製以往報名(勾選多筆)
### 傳回
``` C#
    
```
## [HttpPost] api/apporder/GetPayOrderList
### 介面
``` C#    
    [HttpPost]
    [Route("api/apporder/GetPayOrderList")]
    public IHttpActionResult GetPayOrderList([FromBody] Model.pro_order_record q, 
        int page, int pageSize = 10,
        string sortBy = "", bool sortDesc = false)
```
收款註記
### 傳回
``` C#
    new
    {
        list = List of new
        {
            id ,
            num ,
            order_no ,
            pay_date ,
            payment_selected = new
            {
                text,
                val ,
            },
            price,
            organization,
            bank_code,
        }),
        count,
    }
```
## [HttpDelete] api/apporder/DeleteRecordDetail/{id}")]
刪除收款註記
### 介面
``` C#    
    [HttpDelete]
    [Route("api/apporder/DeleteRecordDetail/{id}")]//刪除收款註記
    public void DeleteRecordDetail(int id)
```
### 傳回
``` C#
    
```
## [HttpPost] api/apporder/SaveRecordDetail
### 介面
``` C#    
    [HttpPost]
    [Route("api/apporder/SaveRecordDetail")]
    public IHttpActionResult SaveRecordDetail([FromBody] Model.pro_order_record item)
```
儲存收款紀錄
### 傳回
``` C#
    
```
