private void setStatus() { BathDBDataContext db_new = new BathDBDataContext(LogIn.connectionString); if (!BathClass.getAuthority(db_new, LogIn.m_User, "营业信息查看")) { statusStrip2.Visible = false; return; } seatTotal.Text = db_new.Seat.Count().ToString(); seatAvi.Text = db_new.Seat.Where(x => x.status == 1).Count().ToString(); DateTime st = DateTime.Parse("2013-1-1 00:00:00"); if (db_new.ClearTable.Count() != 0) { st = db_new.ClearTable.ToList().Last().clearTime; } int count = 0; double pm = BathClass.get_paid_expense(db_new, st, ref count); seatPaid.Text = count.ToString(); moneyPaid.Text = pm.ToString(); seatUnpaid.Text = db_new.Seat.Where(x => x.status == 2 || x.status == 6 || x.status == 7 || x.status == 8).Count().ToString(); double upm = BathClass.get_unpaid_expense(db_new, LogIn.connectionString); moneyUnpaid.Text = upm.ToString(); moneyTotal.Text = (pm + upm).ToString(); }
//设置营业信息状态栏 private void setStatus() { BathDBDataContext db_new = new BathDBDataContext(LogIn.connectionString); if (!BathClass.getAuthority(db_new, LogIn.m_User, "营业信息查看")) { statusStrip2.Visible = false; return; } seatTotal.Text = db_new.HotelRoom.Count().ToString(); seatAvi.Text = db_new.HotelRoom.Where(x => x.status == 1).Count().ToString(); int count = 0; double pm = BathClass.get_paid_expense(db_new, thisTime, ref count); seatPaid.Text = count.ToString(); moneyPaid.Text = pm.ToString(); seatUnpaid.Text = db_new.HotelRoom.Where(x => x.status == 2 || x.status == 6 || x.status == 7 || x.status == 8).Count().ToString(); double upm = BathClass.get_unpaid_expense(db_new, LogIn.connectionString); moneyUnpaid.Text = upm.ToString(); moneyTotal.Text = (pm + upm).ToString(); }