private void btn_Thanhtoan_Click(object sender, EventArgs e) { hoiVien data = new hoiVien(); GoiTap data2 = new GoiTap(); int Duration = data2.getDuration(cmb_goiTap.Text.Split('-')[0]); data.AddPayment(txt_maHV.Text.Split('-')[0], cmb_goiTap.Text.Split('-')[0], dtP_payDate.Value, Duration, int.Parse(txt_amount.Text)); log.Insert("Thực hiện thanh toán cho hội viên " + txt_maHV.Text); retrieveInfo(); }
private void numOfMemeachMonth() { c_ThongKe.DataSource = null; hoiVien hoivien = new hoiVien(); DataTable hoivienList = hoivien.getMemberofMonth(dt_fromDate.Value, dt_toDate.Value); c_ThongKe.DataSource = hoivienList; c_ThongKe.ChartAreas["ChartArea1"].AxisX.Title = "Nhóm"; c_ThongKe.ChartAreas["ChartArea1"].AxisX.Title = "Tổng số lượng"; c_ThongKe.Series["Số lượng"].XValueMember = "thang"; c_ThongKe.Series["Số lượng"].YValueMembers = "total"; c_ThongKe.Series["Số lượng"].Color = Color.Blue; Log.Insert("Xem thông tin hội viên từng tháng"); }
private void xóaLịchSửGiaoDịchToolStripMenuItem_Click(object sender, EventArgs e) { DialogResult dlg = MessageBox.Show("Bạn muốn xóa lịch sử giao dịch này?", "Xóa hội viên", MessageBoxButtons.YesNo); if (dlg == DialogResult.Yes) { int currentRowIndex = dtgv_PaymentHistory.CurrentCellAddress.Y;// 'current row selected if (-1 < currentRowIndex && currentRowIndex < dtgv_PaymentHistory.RowCount) { hoiVien data = new hoiVien(); string mahv = data.GetIDfromName(dtgv_PaymentHistory.Rows[currentRowIndex].Cells["HoiVien"].Value.ToString()); DateTime payDate = Convert.ToDateTime(dtgv_PaymentHistory.Rows[currentRowIndex].Cells["dateOfPay"].Value.ToString()); data.DeletePayment(mahv, payDate); log.Insert("Thực hiện xóa lịch sử thanh toán của hội viên " + mahv); retrieveInfo(); } } }
private void LoadData() { GoiTap data1 = new GoiTap(); hoiVien data2 = new hoiVien(); DataTable goiTapList = data1.getPlanList(); DataTable hoiVienList = data2.getMemberList(); cmb_goiTap.DataSource = goiTapList; cmb_goiTap.DisplayMember = "List"; cmb_goiTap.ValueMember = "List"; AutoCompleteStringCollection allowedTypes = new AutoCompleteStringCollection(); allowedTypes = GetAutoSourceCollectionFromTable(hoiVienList); txt_maHV.AutoCompleteCustomSource = allowedTypes; txt_maHV.AutoCompleteMode = AutoCompleteMode.Suggest; txt_maHV.AutoCompleteSource = AutoCompleteSource.CustomSource; //SetHeader(); }
private void retrieveInfo() { hoiVien data = new hoiVien(); DataTable hoiVienList = data.getMemberpaymentinfo(txt_maHV.Text.Split('-')[0]); try { txt_tenHV.Text = txt_maHV.Text.Split('-')[1].Trim(); cmb_goiTap.Text = (from DataRow dr in hoiVienList.Rows where true select(string) dr["Goi"]).LastOrDefault(); txt_amount.Text = (from DataRow dr in hoiVienList.Rows where true select(int) dr["price"]).LastOrDefault().ToString(); dtgv_PaymentHistory.DataSource = hoiVienList; SetHeader(); } catch (Exception ex) { } }