コード例 #1
0
        public int Xoa(string id)
        {
            SqlCommand cmd = new SqlCommand();

            cmd.CommandText = "DELETE FROM Liquidate WHERE Id_Liqui = @id";
            cmd.Parameters.Add("id", SqlDbType.Int).Value = Convert.ToInt32(id);
            return(cls.CapNhatDL(cmd));
        }
コード例 #2
0
        public int Xoa(string id)
        {
            SqlCommand cmd = new SqlCommand();

            cmd.CommandText = "DELETE FROM Device WHERE Id_Device = @id AND Status_Device != N'Đang sử dụng'";
            cmd.Parameters.Add("id", SqlDbType.Int).Value = Convert.ToInt32(id);
            return(cls.CapNhatDL(cmd));
        }
コード例 #3
0
        public int Update(Object.ObjTypeDevice objType)
        {
            SqlCommand cmd = new SqlCommand();

            cmd.CommandText = "UPDATE Type_Device SET Name_Device = @nameDevcie WHERE Id_Type = @id; ";

            cmd.Parameters.Add("nameDevcie", SqlDbType.NVarChar).Value = objType.Name_Device;
            cmd.Parameters.Add("id", SqlDbType.Int).Value = objType.Id_Type;

            return(cls.CapNhatDL(cmd));
        }
コード例 #4
0
        public int Update(ObjAccount acc)
        {
            SqlCommand cmd = new SqlCommand();

            cmd.CommandText = "UPDATE Account SET PassWord_Customer = @pass WHERE Id_Customer = @id AND User_Name_Customer = @ten; ";

            cmd.Parameters.Add("ten", SqlDbType.NVarChar).Value  = acc.UserName_Customer;
            cmd.Parameters.Add("pass", SqlDbType.NVarChar).Value = acc.PassWord_Customer;
            cmd.Parameters.Add("id", SqlDbType.Int).Value        = acc.Id_Customer;

            return(cls.CapNhatDL(cmd));
        }
コード例 #5
0
        public int Update(Object.ObjRentDevice objRentDevice)
        {
            SqlCommand cmd = new SqlCommand();

            cmd.CommandText = "UPDATE Rent_Device " +
                              "SET Date_Rent = @dayRent, Date_Pay = @dayPay, " +
                              "Id_Device = @idDevice, " +
                              "Id_Customer = @idCustomer, " +
                              "Status_Rent = @status " +
                              "WHERE Id_Rent = @idRent; ";

            cmd.Parameters.Add("dayRent", SqlDbType.DateTime).Value = objRentDevice.Day_Rent;
            cmd.Parameters.Add("dayPay", SqlDbType.DateTime).Value  = objRentDevice.Day_Pay;
            cmd.Parameters.Add("idDevice", SqlDbType.Int).Value     = objRentDevice.Id_Device;
            cmd.Parameters.Add("idCustomer", SqlDbType.Int).Value   = objRentDevice.Id_Customer;
            cmd.Parameters.Add("status", SqlDbType.NVarChar).Value  = objRentDevice.Status_Device;
            cmd.Parameters.Add("idRent", SqlDbType.Int).Value       = objRentDevice.Id_Rent;

            return(cls.CapNhatDL(cmd));
        }