private void FrmOperation_Load(object sender, EventArgs e) { this.Focus(); CmpSetDgv(); dgvOperationlog.DataSource = OperationDao.SelectOperationlogAll(); spOperationlog.DataSource = SpendDao.SelectSpendOperation(); }
private void spendClear_Click(object sender, EventArgs e) { string sql = "delete from spend"; int n = DBHelper.ExecuteNonQuery(sql); if (n > 0) { MessageBox.Show("删除日志成功", "删除提示"); spOperationlog.DataSource = SpendDao.SelectSpendOperation(); } else { MessageBox.Show("删除日志失败", "错误提示"); } }
private void spOperation_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == this.spOperationlog.Columns["SpendDelete"].Index) { //判断列索引是不是删除按钮 int rows = spOperationlog.CurrentRow.Index; //得到当前行的索引 int spendId = (int)(spOperationlog.Rows[rows].Cells[1].Value); if (spendId != 0 && MessageBox.Show("您确定要删除吗?", "重要提示!", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation) == System.Windows.Forms.DialogResult.OK) { string sql = "delete from spend where SpendId='" + spendId + "'"; int n = DBHelper.ExecuteNonQuery(sql); if (n > 0) { MessageBox.Show("删除日志成功", "删除提示"); spOperationlog.DataSource = SpendDao.SelectSpendOperation(); } else { MessageBox.Show("删除日志失败", "错误提示"); } } } }
/// <summary> /// 根据房间编号、入住时间和当前时间修改结算状态 /// </summary> /// <param name="roomno"></param> /// <param name="checktime"></param> /// <returns></returns> public static int UpdateMoneyState(string roomno, string checktime) { return(SpendDao.UpdateMoneyState(roomno, checktime)); }
/// <summary> /// 根据房间编号、入住时间到当前时间查询消费总金额 /// </summary> /// <param name="roomno"></param> /// <returns></returns> public static object SelectMoneyByRoomNoAndTime(string roomno) { return(SpendDao.SelectMoneyByRoomNoAndTime(roomno)); }
/// <summary> /// 根据房间号查询消费的所有信息 /// </summary> /// <returns></returns> public static List <Spend> SelectSpendInfoRoomNo(string RoomNo) { return(SpendDao.SelectSpendInfoRoomNo(RoomNo)); }
public static List <Spend> SelectSpendInfoAll() { return(SpendDao.SelectSpendInfoAll()); }
public static List <Spend> SelectSpendByCustoNo(string No) { return(SpendDao.SelectSpendByCustoNo(No)); }
public static int InsertSpendInfo(Spend s) { return(SpendDao.InsertSpendInfo(s)); }