private void LoadData() { BaoCaoNo bcn = new BaoCaoNo(); bcn.ThangBaoCao = curr; dgv_DSachKhachHang.DataSource = BaoCaoNo_CT.LoadData(bcn); FormatGrid(); }
private void uc_OweReport_Load(object sender, EventArgs e) { cbo_Year.DataSource = BaoCaoNo.LoadYear(); cbo_Year.DisplayMember = "Nam"; cbo_Year.ValueMember = "Nam"; cbo_Year.Text = DateTime.Today.ToString("yyyy"); pn_T10.Appearance.BackColor = Color.Salmon; pn_T10.Appearance.Options.UseBackColor = true; pn_T10.LookAndFeel.UseDefaultLookAndFeel = false; pn_T10.LookAndFeel.Style = LookAndFeelStyle.Flat; curr = new DateTime(2016, 10, 01); LoadData(); }
public bool ThemBaoCao(BaoCaoNo baocaono) { if (conn.State != System.Data.ConnectionState.Open) { conn.Open(); } try { SqlCommand cmd = new SqlCommand(); cmd.Connection = conn; cmd.CommandType = CommandType.Text; cmd.CommandText = System.String.Concat("insert into baocaono (thang,nam,makh,tenkh,tienthu,nophatsinh,no) values('" + baocaono.Thang.ToString() + "','" + baocaono.Nam.ToString() + "','" + baocaono.MaKH + "',N'" + baocaono.TenKH + "'," + baocaono.TienThu.ToString() + "," + baocaono.NoPhatSinh.ToString() + "," + baocaono.No.ToString() + ")"); cmd.CommandType = CommandType.Text; cmd.ExecuteNonQuery(); conn.Close(); return(true); } catch { conn.Close(); return(false); } }
public bool ThemBaoCao(BaoCaoNo baocao) { return(objBaoCao.ThemBaoCao(baocao)); }