public RoomRegZzwHelp getthis(long roomRegId) { var lflist = new List <Model.RoomReg>(); var treeList = RoomRegBll.GetLfTree(roomRegId, UserContext.CurrentUser.HotelId, ref lflist); var roomReg = new Model.RoomReg(); decimal yszk = 0, yuszk = 0, yjs = 0, zfy = 0, zstk = 0, jy = 0, bfsk = 0; if (treeList.Count > 0) { //roomRegId = long.Parse(treeList[0].id); //获取房间的登记信息 roomReg = RoomRegBll.GetById(roomRegId); if (roomReg != null) { yszk += roomReg.Yszk; yuszk += roomReg.Yuszk; yjs += roomReg.Yjs; zfy += roomReg.Money; zstk += roomReg.Zstk; jy += roomReg.Jy; bfsk += roomReg.YeBfSkMoney + roomReg.FyeBfSkMoney; } ViewBag.RoomReg = roomReg; //获取所有联房的房间的财务汇总 for (var i = 1; i < treeList.Count; i++) { var item = RoomRegBll.GetById(long.Parse(treeList[i].id)); if (item != null) { yszk += item.Yszk; yuszk += item.Yuszk; yjs += item.Yjs; zfy += item.Money; zstk += item.Zstk; jy += item.Jy; bfsk += item.YeBfSkMoney + item.FyeBfSkMoney; } } } RoomRegZzwHelp rrom = new RoomRegZzwHelp() { yszk = yszk, yuszk = yuszk, yjs = yjs, zfy = zfy, zstk = zstk, jy = jy, bfsk = bfsk }; return(rrom); }
public JsonResult RefreshTree(long roomRegId) { var lflist = new List <Model.RoomReg>(); var treeList = RoomRegBll.GetLfTree(roomRegId, UserContext.CurrentUser.HotelId, ref lflist); var roomReg = new Model.RoomReg(); decimal yszk = 0, yuszk = 0, yjs = 0, zfy = 0, zstk = 0, jy = 0, bfsk = 0; if (treeList.Count > 0) { //roomRegId = long.Parse(treeList[0].id); //获取房间的登记信息 roomReg = RoomRegBll.GetById(roomRegId); if (roomReg != null) { yszk += roomReg.Yszk; yuszk += roomReg.Yuszk; yjs += roomReg.Yjs; zfy += roomReg.Money; zstk += roomReg.Zstk; jy += roomReg.Jy; bfsk += roomReg.YeBfSkMoney + roomReg.FyeBfSkMoney; } ViewBag.RoomReg = roomReg; //获取所有联房的房间的财务汇总 for (var i = 1; i < treeList.Count; i++) { var item = RoomRegBll.GetById(long.Parse(treeList[i].id)); if (item != null) { yszk += item.Yszk; yuszk += item.Yuszk; yjs += item.Yjs; zfy += item.Money; zstk += item.Zstk; jy += item.Jy; bfsk += item.YeBfSkMoney + item.FyeBfSkMoney; } } } //在treelist上面加一个全部 var root = new RoomRegTree() { id = "0", @checked = false, children = treeList, text = "全部" }; var tree = new List <RoomRegTree>() { root }; var zzw = new RoomRegZzwHelp() { yszk = yszk, yuszk = yuszk, yjs = yjs, zfy = zfy, zstk = zstk, jy = jy, bfsk = bfsk }; //获取未结账房间数,为了结账时方式的判断 //lflist = lflist.Where(m => m.CwState != 3 && m.CwState != 4 && m.CwState != 2).ToList(); lflist = lflist.Where(m => m.CwState == 1).ToList(); return(Json(new { zzw = zzw, tree = tree, wjsRoomCount = lflist.Count })); }