Esempio n. 1
0
        public bool UpdateData(NhapPhuTungObj NhapPTObj)
        {
            cmd.CommandText = string.Format("UPDATE tblNhapPhuTung SET MANPT = '{0}', MANHACC = '{1}', MANV = '{2}', NGAYNHAP = CONVERT(date, '{3}', 103) WHERE (MANPT = '{0}')", NhapPTObj.MaNhapPhuTung, NhapPTObj.MaNhaCungCap, NhapPTObj.MaNV, NhapPTObj.NgayNhap);
            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);
        }
Esempio n. 2
0
        public bool AddData(NhapPhuTungObj NhapPTObj)
        {
            cmd.CommandText = string.Format("INSERT INTO tblNhapPhuTung (MANPT, MANHACC, MANV, NGAYNHAP) VALUES ('{0}', '{1}', '{2}', CONVERT(date, '{3}', 103))", NhapPTObj.MaNhapPhuTung, NhapPTObj.MaNhaCungCap, NhapPTObj.MaNV, NhapPTObj.NgayNhap);
            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);
        }
Esempio n. 3
0
 public bool updateData(NhapPhuTungObj NhapPhuTungObj)
 {
     return(NhapPTMod.UpdateData(NhapPhuTungObj));
 }
Esempio n. 4
0
 public bool addData(NhapPhuTungObj NhapPhuTungObj)
 {
     return(NhapPTMod.AddData(NhapPhuTungObj));
 }