| | |
| | | /// 列表页 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public IActionResult Index() |
| | | public IActionResult Index(int year,string sim) |
| | | { |
| | | List<ActionEntity> actionlist = new List<ActionEntity>(); |
| | | ActionEntity actionEntity = new ActionEntity(); |
| | | actionEntity.OpenType = 0; |
| | | actionEntity.ActionUrl = ""; |
| | | actionEntity.ActionFun = "Search"; |
| | | actionEntity.PageIco = "fa fa-search"; |
| | | actionEntity.ActionName = "查询"; |
| | | actionlist.Add(actionEntity); |
| | | //List<ActionEntity> actionlist = new List<ActionEntity>(); |
| | | //ActionEntity actionEntity = new ActionEntity(); |
| | | //actionEntity.OpenType = 0; |
| | | //actionEntity.ActionUrl = ""; |
| | | //actionEntity.ActionFun = "Search"; |
| | | //actionEntity.PageIco = "fa fa-search"; |
| | | //actionEntity.ActionName = "查询"; |
| | | //actionlist.Add(actionEntity); |
| | | |
| | | ActionEntity actionEntity1 = new ActionEntity(); |
| | | actionEntity1.OpenType = 0; |
| | | actionEntity1.ActionUrl = ""; |
| | | actionEntity1.ActionFun = "Add"; |
| | | actionEntity1.PageIco = "fa fa-plus"; |
| | | actionEntity1.ActionName = "新增"; |
| | | actionlist.Add(actionEntity1); |
| | | //ActionEntity actionEntity1 = new ActionEntity(); |
| | | //actionEntity1.OpenType = 0; |
| | | //actionEntity1.ActionUrl = ""; |
| | | //actionEntity1.ActionFun = "Add"; |
| | | //actionEntity1.PageIco = "fa fa-plus"; |
| | | //actionEntity1.ActionName = "新增"; |
| | | //actionlist.Add(actionEntity1); |
| | | |
| | | |
| | | //ActionEntity actionEntity4 = new ActionEntity(); |
| | |
| | | //actionEntity4.ActionName = "批量删除"; |
| | | //actionlist.Add(actionEntity4); |
| | | |
| | | ViewData["ActionInfo"] = actionlist; |
| | | //ViewData["ActionInfo"] = actionlist; |
| | | ViewBag.Year = year; |
| | | ViewBag.Sim = sim; |
| | | //var js= _simService.SearchSimCostByPage(sim, year) |
| | | return View(); |
| | | } |
| | | |
| | |
| | | /// </summary> |
| | | /// <param name="search"></param> |
| | | /// <returns></returns> |
| | | public IActionResult GetList(SimCostDTOSearch search) |
| | | public IActionResult GetList(int year, string sim) |
| | | { |
| | | return new JsonResult(_simService.SearchSimCostByPage(search)); |
| | | var list = _simService.SearchSimCostByPage(sim, year); |
| | | |
| | | //var result = new |
| | | //{ |
| | | // total:"1", |
| | | // page: 1, |
| | | // records: list.Count, |
| | | // rows: list |
| | | //}; |
| | | return Json(list); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | /// <param name="id"></param> |
| | | /// <returns></returns> |
| | | public IActionResult Edit(string id=null) |
| | | { |
| | | ViewBag.SimCard = _simService.GetBindSim(); |
| | | public IActionResult Edit(string id,decimal money,int year, int month,string sim) |
| | | { |
| | | SimCost dto = new SimCost(); |
| | | dto.accounted_time = DateTime.Now; |
| | | if (!string.IsNullOrEmpty(id)) |
| | | { |
| | | dto = _simService.GetSimCost(int.Parse(id)); |
| | | } |
| | | dto.bill_month = month; |
| | | dto.bill_amount = money; |
| | | dto.sim_id = id; |
| | | dto.sub_userid = sim; |
| | | dto.bill_year = year; |
| | | //if (!string.IsNullOrEmpty(id)) |
| | | //{ |
| | | // dto = _simService.GetSimCost(int.Parse(id)); |
| | | //} |
| | | ViewData.Model = dto; |
| | | return View(); |
| | | } |
| | |
| | | return new JsonResult(resultEntity); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 列表页 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public IActionResult SimYear() |
| | | { |
| | | return View(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 列表内容 |
| | | /// </summary> |
| | | /// <param name="search"></param> |
| | | /// <returns></returns> |
| | | public IActionResult GetSimYearList(SimCostDTOSearch search) |
| | | { |
| | | var list = _simService.SearchSimCostYearByPage(search); |
| | | return new JsonResult(list); |
| | | } |
| | | |
| | | [HttpPost] |
| | | public IActionResult SaveSimYearCost(object data) |
| | | { |
| | | var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); |
| | | ResultEntity resultEntity = new ResultEntity(); |
| | | //using (TransactionScope scope = new TransactionScope()) |
| | | //{ |
| | | // data.sub_userid = curentuser.Id; |
| | | // resultEntity = _simService.SaveCost(data); |
| | | // scope.Complete(); |
| | | //} |
| | | return new JsonResult(resultEntity); |
| | | } |
| | | |
| | | ///// <summary> |
| | | ///// 解绑 |
| | | ///// </summary> |