void ganDuLieu(KyLuatObjTH Obj)
 {
     Obj.makl       = txt_makl.Text.Trim();;
     Obj.tenkl      = txt_tenkl.Text.Trim();
     Obj.hinhthuc   = txt_hinhthuc.Text.Trim();
     Obj.nguyennhan = txt_nguyennhan.Text.Trim();
     Obj.quydoi     = txt_quydoi.Text.Trim();
 }
Exemple #2
0
        public bool AddData(KyLuatObjTH Obj)
        {
            cmd.CommandText = " insert into KyLuat (MaKL,TenKL,HinhThuc,NguyenNhan,QuyDoiRaTienMat) values('" + Obj.makl + "',N'" + Obj.tenkl + "',N'" + Obj.hinhthuc + "' ,N'" + Obj.nguyennhan + "',N'" + Obj.quydoi + "')";
            cmd.CommandType = CommandType.Text;
            cmd.Connection  = con.Connection;

            try
            {
                con.OpenConn();
                cmd.ExecuteNonQuery();

                return(true);
            }
            catch (Exception ex)
            {
                string mex = ex.Message;
                cmd.Dispose();
                con.CloseConn();
            }

            return(false);
        }
Exemple #3
0
        public bool UpDate(KyLuatObjTH Obj)
        {
            cmd.CommandText = " update KyLuat set TenKL = N'" + Obj.tenkl + "' , HinhThuc = N'" + Obj.hinhthuc + "' , NguyenNhan = N'" + Obj.nguyennhan + "' , QuyDoiRaTienMat = N'" + Obj.quydoi + "' where MaKL = '" + Obj.makl + "'";
            cmd.CommandType = CommandType.Text;
            cmd.Connection  = con.Connection;


            try
            {
                con.OpenConn();
                cmd.ExecuteNonQuery();

                return(true);
            }
            catch (Exception ex)
            {
                string mex = ex.Message;
                cmd.Dispose();
                con.CloseConn();
            }

            return(false);
        }
 public bool upData(KyLuatObjTH ktObj)
 {
     return(klMod.UpDate(ktObj));
 }
 public bool addData(KyLuatObjTH klObj)
 {
     return(klMod.AddData(klObj));
 }