Exemple #1
0
        public bool UpdateData(ChiTietNhapPhuTungObj CTNhapPTObj)
        {
            cmd.CommandText = string.Format("UPDATE tblChiTietNhapPhuTung SET MACTNPT = '{0}', MANPT = '{1}', MATTPT = '{2}', DONGIANHAP = {3}, SOLUONG = {4} WHERE (MACTNPT = '{0}')", CTNhapPTObj.MaCTNhapPT, CTNhapPTObj.MaNhapPT, CTNhapPTObj.MaTTPT, CTNhapPTObj.DonGiaNhap, CTNhapPTObj.SoLuong);
            cmd.Connection  = con.Connection;

            try
            {
                con.openCon();
                cmd.ExecuteNonQuery();
                con.closeCon();
                return(true);
            }
            catch (Exception ex)
            {
                string mes = ex.Message;
                cmd.Dispose();
                con.closeCon();
            }

            return(false);
        }
Exemple #2
0
        public bool AddData(ChiTietNhapPhuTungObj CTNhapPTObj)
        {
            cmd.CommandText = string.Format("INSERT INTO tblChiTietNhapPhuTung (MACTNPT, MANPT, MATTPT, DONGIANHAP, SOLUONG) VALUES ('{0}', '{1}', '{2}', {3}, {4})", CTNhapPTObj.MaCTNhapPT, CTNhapPTObj.MaNhapPT, CTNhapPTObj.MaTTPT, CTNhapPTObj.DonGiaNhap, CTNhapPTObj.SoLuong);
            cmd.CommandType = CommandType.Text;
            cmd.Connection  = con.Connection;

            try
            {
                con.openCon();
                cmd.ExecuteNonQuery();
                con.closeCon();
                return(true);
            }
            catch (Exception ex)
            {
                string mes = ex.Message;
                cmd.Dispose();
                con.closeCon();
            }

            return(false);
        }
Exemple #3
0
 public bool updateData(ChiTietNhapPhuTungObj CTNhapPTObj)
 {
     return(CTNhapPTMod.UpdateData(CTNhapPTObj));
 }
Exemple #4
0
 public bool addData(ChiTietNhapPhuTungObj CTNhapPTObj)
 {
     return(CTNhapPTMod.AddData(CTNhapPTObj));
 }