Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Dictionary<string, object> getByTagihan(int type)
- {
- try
- {
- var sql = @"SELECT [DACode]
- ,[Sequence]
- ,[DueDate]
- ,[SettValue]
- ,[InterestVal]
- ,[TotalBill]
- ,[IsPaid]
- From (select [DACode]
- ,[Sequence]
- ,[DueDate]
- ,[SettValue]
- ,[InterestVal]
- ,[TotalBill]
- ,[IsPaid] ,row_number() over(partition by DACode order by sequence) rn
- from InstSchedule where IsPaid = 0) t
- where rn = 1 ";
- if (type == 1) { sql += "AND Month(DueDate) <= Month(getDate()) + 1 "; }
- else if (type == 2) { sql += "AND Month(DueDate) > Month(getDate()) "; }
- var data =
- _db.Query<InstSchedule>(sql).ToList();
- return _message.SuccessData(true, data, _message.MessageSuccess);
- }
- catch (Exception ex)
- {
- return _message.Failed(true, ex.Message);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement